Re: File upload with Cocoon
On Friday 08 November 2002 10:15, Volker Schneider wrote: does anybody know how I can do a file upload using the html input type=file ../ tag? This might help: http://outerthought.net/wiki/Wiki.jsp?page=FileUploadWithAction -Bertrand - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: File upload with Cocoon
Sir, Someone pointed out to me that Cocoon handles file uploading for you. I was rather skeptical - but, i just tried it and it works. On client machine, i used a browser and my form with an enctype=multipart/form-data, an HTML INPUT tag of type file, and an HTML INPUT of type submit. Of course, your pipeline answers the match for handling the form. And guess what, the file is sitting on my server at c:\program files\apache group\tomcat 4.1\work\standalone\localhost\cocoon\cocoon-files\upload-dir. IT'S A BEAUTIFUL THING. But, ya know, it is just like i tell the folks that i work with - You may have done the greatest things, but unless you can tell others (written) about what you have done - you have done nothing. Having found the hidden gem, my next step is to take the form data and place it into an email body and attach the uploaded file to the email and send it on its way. It is gonna take me longer to find out how to do it than what it will take for me to actually do it. good luck, Sir, Ray -Original Message- From: Volker Schneider [mailto:volker.schneider;danet.de] Sent: Friday, November 08, 2002 4:15 AM To: [EMAIL PROTECTED] Subject: File upload with Cocoon Dear colleagues, does anybody know how I can do a file upload using the html input type=file ../ tag? Do you have an example pipeline? What shall I do with the result? Where can I get the content of the selected file from? Thank you, best regards - Volker - - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File upload with Cocoon (how about a summary?)
On Friday 08 November 2002 13:40, Ray Martin wrote: . . . But, ya know, it is just like i tell the folks that i work with - You may have done the greatest things, but unless you can tell others (written) about what you have done - you have done nothing. . . . Sure - we're all aware of the current suboptimal state of the docs. So maybe you (or Volker) would be nice enough to write a [SUMMARY] with a minimal example of how you got this to work? Or even better, write or complete a page at the Wiki [1] with this info? This would be a great help in improving the docs. -Bertrand [1] http://outerthought.net/wiki/Wiki.jsp - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File upload with Cocoon
And what can I do to disable cocoon's automatic file uploading? I want to send files to cocoon but not to save them in disk And another question about http://outerthought.net/wiki/Wiki.jsp?page=FileUploadWithAction I've seen that the example uses Request request = ObjectModelHelper.getRequest(objectModel); FilePartFile filePartFile = (FilePartFile)request.get(uploadfile); to get the FilePartFile object. If I change the second line in order to get a FilePartArray it doesn't work. Do you know any solution? Thanks Oskar - Original Message - From: Ray Martin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 08, 2002 1:40 PM Subject: RE: File upload with Cocoon Sir, Someone pointed out to me that Cocoon handles file uploading for you. I was rather skeptical - but, i just tried it and it works. On client machine, i used a browser and my form with an enctype=multipart/form-data, an HTML INPUT tag of type file, and an HTML INPUT of type submit. Of course, your pipeline answers the match for handling the form. And guess what, the file is sitting on my server at c:\program files\apache group\tomcat 4.1\work\standalone\localhost\cocoon\cocoon-files\upload-dir. IT'S A BEAUTIFUL THING. But, ya know, it is just like i tell the folks that i work with - You may have done the greatest things, but unless you can tell others (written) about what you have done - you have done nothing. Having found the hidden gem, my next step is to take the form data and place it into an email body and attach the uploaded file to the email and send it on its way. It is gonna take me longer to find out how to do it than what it will take for me to actually do it. good luck, Sir, Ray -Original Message- From: Volker Schneider [mailto:volker.schneider;danet.de] Sent: Friday, November 08, 2002 4:15 AM To: [EMAIL PROTECTED] Subject: File upload with Cocoon Dear colleagues, does anybody know how I can do a file upload using the html input type=file ../ tag? Do you have an example pipeline? What shall I do with the result? Where can I get the content of the selected file from? Thank you, best regards - Volker - - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File upload with Cocoon
Also see the file upload example at: /samples/xsp/upload and look at the javadocs for org.apache.cocoon.components.request.multipart.FilePartFile which can give you a reference to the File stored on disk (automatically by default) or an InputStream to read the contents and do something with them if that's what you need to do. Search the dev list archives for recent messages about file upload. Someone had a recent question about this over there. Geoff Howard --- Volker Schneider [EMAIL PROTECTED] wrote: Dear colleagues, does anybody know how I can do a file upload using the html input type=file ../ tag? Do you have an example pipeline? What shall I do with the result? Where can I get the content of the selected file from? Thank you, best regards - Volker - - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File upload with Cocoon
--- Oskar Casquero [EMAIL PROTECTED] wrote: And what can I do to disable cocoon's automatic file uploading? I want to send files to cocoon but not to save them in disk you configure it in web.xml: http://marc.theaimsgroup.com/?l=xml-cocoon-devm=103676501932187w=2 And another question about http://outerthought.net/wiki/Wiki.jsp?page=FileUploadWithAction I've seen that the example uses ... FilePartFile filePartFile = (FilePartFile)request.get(uploadfile); to get the FilePartFile object. If I change the second line in order to get a FilePartArray it doesn't work. Do you know any solution? It is either a FilePartFile or FilePartArray already, based on the setting in web.xml mentioned above. They both extend FilePart, so you can use polymorphism and just do: FilePart filePart = (FilePart)request.get(uploadfile); and then InputStream is = filePart.getInputStream(); Which will work regardless of the setting in web.xml. I have been planning on adding a third setting for web.xml which will make the uploaded file on disk temporary, removed at the end of the request - so the polymorphic handling there is the better way to go than relying on it being a FilePartArray from a forwards compatibility standpoint. Geoff Howard __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]