Yes, you do, use the filecommonupload old version... i'm usin that version,
i dont remember what number because i'm not stay in my office. If you can,
writeme to [EMAIL PROTECTED] to remember and send the code for the group
and for you.


atte.
Walter E. Zegarra
Synopsis Developer
[EMAIL PROTECTED]

Lima - Peru

2007/7/18, Martin Cooper <[EMAIL PROTECTED]>:

On 7/18/07, redomancer redomancer <[EMAIL PROTECTED]> wrote:
>
> Hello!
> I am not sure i am posting the questions in right place, but i have no
> other
> option.


Um, yes, you do - the Commons User list is the place for questions like
this. Nevertheless, the answer to your question is in the FileUpload FAQ:

http://jakarta.apache.org/commons/fileupload/faq.html#whole-path-from-IE

--
Martin Cooper


I have problem witch is related to Apache Common File Upload.
>
> First of all - the code I am using for file saving:
>
> /********************************/
>                 FileItemIterator anIterator = (new
> ServletFileUpload()).getItemIterator(aRequest);
>                 FileItemStream anItem = null;
>                 InputStream aInputStream = null;
>                 while (anIterator.hasNext()) {
>                     anItem = anIterator.next();
>                     aInputStream = anItem.openStream();
>                     if (anItem.isFormField())
>                         // ... form field
>                     else {
>                         BufferedInputStream aBufferedInputStream = new
> BufferedInputStream(aInputStream);
>                         OutputStream aOutputStream = new
> FileOutputStream(getRealPath() + anItem.getName());
>                         BufferedOutputStream aBufferedOutputStream = new
> BufferedOutputStream(aOutputStream);
>                         int aStreamedDataSize = 0;
>                         while((aStreamedDataSize =
> aBufferedInputStream.read())!=-1)
> {
>                             aBufferedOutputStream.write
> (aStreamedDataSize);
>                         }
>                         aBufferedOutputStream.flush();
>                         aBufferedOutputStream.close();
>                         aBufferedInputStream.close();
>                         aOutputStream.flush();
>                         aOutputStream.close();
>                     }
>                 }
> /********************************/
>
> getRealPath() is my function what returns the directory where file must
be
> saved.
>
> And now the problem: anItem.getName() for IE7 returns FULL path to file
on
> client side machine.
> For example: if i had file C:\upload_me.txt, then anItem.getName() will
> contain "C:\upload_me.txt" if IE7 submits data;
> for other browsers anItem.getName() will contail value "upload_me.txt".
>
> Is it supposed to be so?
> What data anItem.getName() must return? And what is the correct way to
get
> file name for all browsers then?
>
> P.S.
> Sorry, if my question is silly.
>
>
> redo
>




--
Don´t Worry Be Walter & Alexita....!!!

Reply via email to