I don't really have to reply to this, but I will anyways.

My scenario has been the same since the start, and I have been helped by a few 
people in my quest to get this done.  I am still using fileupload, but the main 
point is hiow do I pass the data TO THE SERVLET TO DO THE FILEUPLOADING STILL.  
From the other answers provided it seems I can still send my data the same way, 
and I can parse it the same way.

Thanks for the link willl check it out.  The only files I will be uploading in 
addition to the initial file, are imagines.

Makes sense they are the last step, figured there was a way I could do 
something in between there though, but security issues....

The predefined action fup.cgi is a default action that apache FileUpload has 
provided, this is NOT MY CODE but a sample.

IF you would like to see what my servlet code does, then go here 
http://commons.apache.org/proper/commons-fileupload/streaming.html  my actual 
action is /Upload since you seem to care about that.

If someone wants to know what my servlet code is doing, then ask, there is no 
need to be upset over something that honestly doesn't even concern the scope of 
my question.

The thing is that action cannot do what I need to do via my servlet, as others 
have pointed out, so I need to do this with a client on their desktop, unless 
you have some sort of way that I can do it via the browser, but according to 
Hassan that's " NO NO NO A THOUSAND TIMES NO" :)

>> > Its been a long week for me and I can tell by your testiness its been a 
>> > long week for youBe professional and you will get brief appropriate 
>> > responses.
> Provide no info and short testy insults to those who are trying to help you 
> solve YOUR problem and your situation will be exacerbated

It's been a long week for you?  I can tell by the way you address this question 
and with rude responses that you've had a "long week."  Maybe you should calm 
down, there is NO REASON to attack me the way you did, or address me the way 
you did. There is no need to tell someone else to be professional when you are 
attacking them.  I have gotten plenty of nice responses, from nice people 
without the need for insults, this isn't 3rd grade anymore. 

I provided plenty of info, and the only person who is insulting others is 
yourself.  How rude can you be, honestly, I haven't done anything, or said 
anything mean to anyone, and I have thanked everyone for their time.

Maybe you shouldn't try to help people if you are going to have such an 
attitude about it.  It's funny how there are always so many nice people who 
want to help out, but there is always 1-2 know it alls who think they are 
better than everyone else, and if they don't like your question they will try 
to ridicule you.

To anyone who thinks I was mean to you, then I apologize, as I am in no way 
trying to be mean to anyone, and in no way trying to be rude about my 
questions.  I thank each and every one of you for the kindness of helping me 
out during my confusion.  I appreciate all the answers that have been provided.

Thank you for your time.

> From: mgai...@hotmail.com
> To: user@commons.apache.org
> Subject: RE: [fileupload] - Question about uploading additional files other 
> than the ones in the form?
> Date: Sun, 7 Sep 2014 09:59:46 -0400
> 
> with no details provided nobody could understand question your scenario you 
> changed the question from how do I use fileupload  toHow do I use construct 
> MIME multipart message containing non-ascii jpg/gif/etc files
> 
> In the case of MimeMultipart messages you should be following 
> this:http://docs.oracle.com/javaee/6/api/javax/mail/internet/MimeMultipart.html
> In an eventing system such as Apache HTTP Server Actions are the last step on 
> a a form upload thereforeYOU CANNOT CHANGE the contents of a submitted form 
> when the Apache HTTP Server has passed control via submit button to the 
> predefined actionaction action="fup.cgi">
> hiding the contents of action process function fup.cgi so that nobody can 
> possibly understand what the process is doing was not the nicest thing to do..
> In short ANY predefined action <perl/php/java> can include additional files 
> and thus will be able to repack the contents so that by the time you call 
> fileupload  the 'package' will contain all the necessary files
> 
> If you are thinking of a servlet I would suggest using Tomcat but it seems 
> you are using Apache and not sharing who is handling .cgi extensions from 
> Apache httpd.conf 
> 
> Its been a long week for me and I can tell by your testiness its been a long 
> week for youBe professional and you will get brief appropriate responses.
> Provide no info and short testy insults to those who are trying to help you 
> solve YOUR problem and your situation will be exacerbated
> Your choice
> Martin 
> ______________________________________________ 
>                                                                               
>                      
> 
> 
> > From: thekonradz...@hotmail.com
> > To: user@commons.apache.org
> > Subject: RE: [fileupload] - Question about uploading additional files other 
> > than the ones in the form?
> > Date: Sat, 6 Sep 2014 15:29:12 -0400
> > 
> > I'm not sure you understood my question correctly, because I have no idea 
> > what your answer is supposed to be.
> > 
> > Lets try this again.
> > 
> > I have an web app that uses Apache Commons FileUpload to upload files.  I 
> > am using the streaming api to stream files up, and then save them to my 
> > server.  This has nothing to do with my war file, or application files, 
> > this has to do with user submitted files that they themselves will be using 
> > on.
> > 
> > I haven't exactly done the saving, but I know I can save it to my own 
> > filesystem, so I don't think there should be much of a problem saving it to 
> > my server.
> > 
> > 
> > What I am asking is this.
> > 
> > The FileUpload uses a multipart form which is how the data is sent.
> > 
> > 
> > <form method="POST" enctype="multipart/form-data" action="fup.cgi">
> >   File to upload: <input type="file" name="upfile"><br/>
> >   Notes about the file: <input type="text" name="note"><br/>
> >   <br/>
> >   <input type="submit" value="Press"> to upload the file!
> > </form>
> > With this I will select multiple files for upload.
> > 
> > The issue is, I am upload a file, that contains additional data for files 
> > to be uploaded.  Lets call this file A.  File A has to be read in order to 
> > upload additional files which are images.
> > 
> > So when we look at this.
> > 
> > // Check that we have a file upload request
> > boolean isMultipart = ServletFileUpload.isMultipartContent(request);// 
> > Create a new file upload handler
> > ServletFileUpload upload = new ServletFileUpload();
> > 
> > // Parse the request
> > FileItemIterator iter = upload.getItemIterator(request);
> > while (iter.hasNext()) {
> >     FileItemStream item = iter.next();
> >     String name = item.getFieldName();
> >     InputStream stream = item.openStream();
> > We see that the data for the file to be uploaded was sent over through a 
> > request.
> > 
> > My question is basically I want to be able to add additional data to that 
> > request, but I am not adding it myself.  Once I submit a file through the 
> > form, I want to be able to submit more data, and how I do that is my 
> > question.  I want to know what exactly is FileUpload doing to grab the 
> > images and parse them into the Input Stream?  What exactly is the 
> > multipart/data form doing to make this happened, that is what I'm really 
> > looking for.  I will go look over the SRC, but I figured I would ask here.
> > 
> > 
> > As I mentioned before I have a few options that I thought of.
> > 
> > 
> > 1.  Red the data mid stream, and then upload the file(how do I upload)?
> > 2.  Save the file then upload.
> > 
> > 
> > A.  Use a Servlet to fake a form and pass the data to itself?
> > 
> > 
> > So again, user selects file, I read file, then select other files from 
> > their system that are needed for the first file, and upload them all up at 
> > the same time.
> > 
> > Thanks!
> > 
> > > From: mgai...@hotmail.com
> > > To: user@commons.apache.org
> > > Subject: RE: [fileupload] - Question about uploading additional files 
> > > other than the ones in the form?
> > > Date: Sat, 6 Sep 2014 11:44:46 -0400
> > > 
> > > Morning Konradthe <htp/file/ftp>uploader will need to have apriori 
> > > knowledge  of both:location of Main distro usually 'baseDir'
> > > location of ancillary files..pics, classes, sources, html,css
> > > 
> > > This is the reason why you will never see an apache server provisioning 
> > > individual files(except for SVN/GIT) source ctl
> > > 
> > > package ALL files(resource/source/classes/README/doc/etc) up into a jar 
> > > and drop the jar into basedir and let your customers figure out how to 
> > > untar/unzip/unjar the 
> > > filehttp://maven.apache.org/plugins/maven-jar-plugin/
> > > lets pickup this thread on us...@maven.apache.org
> > > HTH
> > > Martin-
> > > 
> > > 
> > > > From: thekonradz...@hotmail.com
> > > > To: user@commons.apache.org
> > > > Subject: [fileupload] - Question about uploading additional files other 
> > > > than the ones in the form?
> > > > Date: Fri, 5 Sep 2014 20:05:03 -0400
> > > > 
> > > > Hello all,
> > > > 
> > > > I am basically uploading a file to my server, but within that file 
> > > > contains path information to images that also need to be uploaded.  I 
> > > > am looking to read the file mid stream and get the data for the images 
> > > > to upload.  It seems I am able to do this, but if this is not possible 
> > > > will I be able save the file, read it, and then be able to get these 
> > > > images?
> > > > 
> > > > I am curious about how I will go about grabbing the additional files?  
> > > > I see that streaming works with InputStream from JavaIO as well as 
> > > > something from CommonsIO, so I figured I could configure something to 
> > > > work with the fileupload stream.
> > > > 
> > > > I also thought that I could possibly try to create a form through my 
> > > > servlet and pass the data through that, but I figured this would be the 
> > > > less favorable approach.
> > > > 
> > > > If anyone has any advice or thoughts I would appreciate it... Thanks!
> > > > 
> > > >                                           
> > >                                     
> >                                       
>                                         
                                          

Reply via email to