Any comment is appreciated.
Originally posted by samjose samjose:
I think sending file as 'attachment (multipart)'/'apache file upload' will create a physical presence of the file in the server.
Correct me if I am wrong.
Can I read the file without creating a physical presence of the file in the server?
No. Not necessarily. We can read the file without writing it back to somewhere. It would be persisted if you want it to like write it somewhere on the server.
By the way, getting update statement from the file, which resides on the client machine . Any particular reasons?
Welcome to the Ranch!
We're a friendly bunch, but we take our display names very seriously.
We require display names to be two words: your first name, a space, then your last name. Fictitious names are not allowed.
Please edit your profile and fix your display name since accounts with invalid display names get deleted.
Originally posted by pawank gupta:
no u cant read file without saving it u programmetically save and delete it
Agreed. If you are particularly talking about Commons Fileupload. Otherwise we can implement it on our own.
Never tried but it sounds like possible to use getInputStream()/getOutputStream in this case, using Commons.
[ July 04, 2006: Message edited by: Adeel Ansari ]
From Fileupload Using Guide
"With uploaded files, you generally will not want to access them via memory, unless they are small, or unless you have no other alternative. Rather, you will want to process the content as a stream, or write the entire file to its ultimate location. FileUpload provides simple means of accomplishing both of these.
Note that, in the default implementation of FileUpload, write() will attempt to rename the file to the specified destination, if the data is already in a temporary file. Actually copying the data is only done if the the rename fails, for some reason, or if the data was in memory.
If you do need to access the uploaded data in memory, you need simply call the get() method to obtain the data as an array of bytes.
[ July 03, 2006: Message edited by: Adeel Ansari ]
Welcome to JavaRanch!
In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see: UseRealWords
Abbreviations such as "u" or "ur" in place of "you" and "you are"
or "you're" confound language translation software making it hard
for our non-English speaking members to read your posts.
Again, welcome to JavaRanch and good luck with your question.
As to your comment.
Jakarta's commons/fileupload will allow you to read the uploaded file into memory and work with it without having to save it to disk.