commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Walter E. Zegarra Sánchez" <walte...@gmail.com>
Subject Re: IE7 and Apache Common File Upload
Date Thu, 19 Jul 2007 14:36:43 GMT
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 walterin@gmail.com to remember and send the code for the group
and for you.


atte.
Walter E. Zegarra
Synopsis Developer
walterin@gmail.com

Lima - Peru

2007/7/18, Martin Cooper <martinc@apache.org>:
>
> On 7/18/07, redomancer redomancer <redomancer@gmail.com> 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....!!!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message