on 02-20-2006 3:43 AM
Hai all,
i want to store one document in SQL Server 2000 through Webdyn pro. I inserted
one document through java into SQL Server 2000 using the following method which name is
insertFile(...).
void insertFile(FileDBTransfer fdb, Connection cn, String FileName)throws IOException, FileNotFoundException, SQLException
{
int FileLength;
FileInputStream fis;
PreparedStatement pstmt;
int last=FileName.lastIndexOf("/");
String docname=FileName.substring(last+1,FileName.length());
fis = fdb.getFileInputStream(FileName);
FileLength= fdb.getFileLength(FileName);
pstmt = cn.prepareStatement("insert into ReportArchive values(?,?)");
pstmt.setString(1,docname);
pstmt.setBinaryStream(2, fis, FileLength); //method to insert a stream of bytes
pstmt.executeUpdate();
}// end insertZipFile
Here i have given file name like "c:\test\test.pdf" it's work fine.
My J2EE server is running different machine and my Netweaver is another machine.
If both server and IDE in same machine it's work fine. But both are in different machine,
i have some problems.
If i try like this server always go and check his own path, not client machine
so it will error like "given source not found". So if i get client machine's path
then i will store easily into SQL Server 2000.
Whenever i run, it should check the client machine path instead of server path.
Thanks in advance,
K.Saravanan.
HI Saravan,
just upload the file into a temp directory in the server and take that file from server's relative path.
for uploading files to server just refer this weblog.
/people/ruediger.bachmann/blog/2006/01/07/uploadingdownloading-files-intofrom-sap
Regards
Kishor Gopinathan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Accessing a directory in the client system is possible only through the upload UI element.
The Web Dynpro application that you have created runs in your server system and hence the c: that you refers to would be that of the server instead of the client machine.
regards,
Noufal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai,
Thank you for your reply.
We are using UIElemetn for File upload.When selecting Browse button File path is displayed on text box.If i want to create one temporary directory on server from client and store the selected file.I am binding one binary variable with file upload.How to fetch selected file path from upload button.
Thanks in Advance,
s.v.selva bala.
Hi Saravan,
Data
-
Determines the data drain, that is, the location of the data, of the file to be uploaded in the context. The system can only read this data value.
fileName
-
Gives exact filename
Refer IWDFileUpload also
http://help.sap.com/saphelp_nw04/helpdata/en/5a/90ff4cd0c8cd48a69b836e5e550880/content.htm
Regards
Kisgor Gopinathan
Message was edited by: Kishor Gopinathan
Message was edited by: Kishor Gopinathan
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.