How to make one application whit attachment File.

Hi Everybody:

I have one requeriment, in one portlet I need to Agree one control "File Input" for Upload one Archive to Server. I does insert the control "File Input" and "File Item" but I don't know what is the next step.

Can you help me at one example of attachment files (Link, code or other)?

Thank for your support… :slight_smile:

Have you had the chance to search this forum for “Attachments”? There are quite a few articles discussing various use cases regarding Attachment handling. I would hope that you could extract some useful information from those existing articles.

Thanks,
–mark

Hi mime:

Thanks for your support, I can do one class in Java with some methods, but the portlet don´t made nothing. Can you tell me how invoke this code from one assync buttom please.

Attachment my code and my image of my portlet.


portlet.txt (6.23 KB)

Please see the attached tutorial. (This will be reposted shortly in the CAF/MWS technical articles site).

It provides step by step instructions for a larger use case then you describe, but it should help you upload a file.

Regards,
–mark
HowToUploadDownloadFiles.doc (401 KB)

Hi mimel:

Thanks for your support, one more time. This is very important for me, I will review and follow the manual step by step.

Thanks. :wink:

Hi one more time mimel :slight_smile:

Applied I the steps of the tutorial, but in the moment at execute it portlet request this error, that can I do for resolved?

Other cuestion, I work in version webMethods 8.0 and in the moment of drag and drop the service in Designer not can I obtein the same window that tutorial, can this affect??

attachment error and image of properties.


Error.txt (523 Bytes)

Hi one more time mimel :slight_smile:

I can resolved it problem thanks and can I see that the service made one folder for the archives in the path of MWS. Only one question more: How can I especify the folder than I want to use for files which attachment?

Thanks.

You’re welcome. Do you want to store the file on the file system, or inside of an MWS folder? (Like Public Folders for instance)

I liked store file in the file system.

Ok. The uploaded file is an instance of org.apache.commons.fileupload.FileItem and here are the javadocs on the apache site: FileItem (Apache Commons FileUpload 1.4 API)

At this point i would recommend using Google to find some java code to create a file on the file system and then copy the contents of the FileItem to that newly created java.io.File object.

Regards,
–mark

Ok mimel, Iwill review.

Thanks for all!! :slight_smile: