File Upload

Hi, All.

Has anybody ever done a file upload ?
Just like normal servlet-jsp based file upload, but handled by WebMethods services ?

I’m trying to avoid coding in Java and import any jar-files like Apache Jakarta: common-upload, and I want the result to be able to be sent to pipeline.
So I’m looking for some more “WebMethods” based solutions.

I’m open to any idea. Thanks in advanced

regards,

K.Kurniawan

I’ve done this before using a browser to post to an IS server. We had to register a multi-part content handler which was done with a simple java service configured as the startup service for the package. But then it was just a matter of building the Flow service to take the post and process it. My service took the filestream posted as an input of type object and a string with the filename.

Here’s the code snippet that registers the multipart content handler:

ServerAPI.registerContentHandler("multipart/form-data", 
				new MultipartContentHandler ());  

Hope that helps.

Hi, John.

Thanks for your info. I’m interested in your solution.

Will you be able to provide more info on how you process the incoming data ? Do you use flow or Java service ?

Thanks and regards,

K.Kurniawan

Hi John,

You mentioned class com.wm.ps.util.handle.MultipartContentHandler. It would appear that in the IS6.1 it is not available. Would you be able to tell me where to get it?

Thanks,
Oscar

I am desired to know the answer,who can tell me?

Hi,

there is a Shareware package available on WmUsers dealing with FileUploads.

http://www.wmusers.com

Maybe you want to check this out.

For Oscar:
Probably this class is included in the PSUtilities-Package available from Advantage.

Regards,
Holger

There is also a sample here on Advantage which I have used.

http://advantage.webmethods.com/cgi-bin/advantage/main.jsp?targChanId=-536884594&oid=161183;30972

Its amazing what you can find by putting a few minutes towards a search…

Thanks holger and brian,
I dowmload the package and it works well.
but I had solved this problem by use JSP and Apache’s commons-fileupload jar.

brian:
I had use keyword “File upload” to search the site,but I can’t get any information except the Glue or Workflow 's fileupload.

Hi All,

I am trying to register content handler for multipart/form-data in my IntegrationServer by using the code found in this thread.

Code:

com.wm.app.b2b.server.ServerAPI.registerContentHandler(“multipart/form-data”, new wm.broker.admin.util.MultipartContentHandler());

But I am getting exception while compiling the java service:

package wm.broker.admin.util does not exist
com.wm.app.b2b.server.ServerAPI.registerContentHandler(“multipart/form-data”, new wm.broker.admin.util.MultipartContentHandler());
^
1 error

Please help me to get rid of this issue.

I am in the process of receive and process of multipart/form-data. Now I am not able to receive any data in the receiving service.

Thanks in advance.
Prasanna.

Hi Prasanna,

The class wm.broker.admin.util.MultipartContentHandler can be found in the WmBrokerAdmin package. So to get it in your classpath you need to have that package installed and activated, furthermore since each package has it’s own classloader, you’ll have to make your customer package which contains this java service dependent on the WmBrokerAdmin package.

This dependency causes the classloader in your package to use the WmBrokerAdmin package to resolve a class when it can’t resolve it.

I hope this helps,
Eric

Thanks Eric. Now class is resolved.

I want to know how to process the incoming multipart form-data in webMethods. I am getting missing start boundary exeption in the receiving end.

I have built the multipart mime message using mime services and posting the mime stream using pub.client:http service to another service.

I have resgitered the multipart form-data content handler by using the code given in this thread and made it as startup service for the package.

If anybody handled multipart form-data, please guide me how to do it.

Thanks in advance.

regards,
Prasanna.

Hi,

The “Missing start boundary” exception has been resolved.

But only the partial content of multipart message is received and not the all parts of the message. Always numparts has got the value “1” in the receiving end and there is no content in it.

If anybody had this problem and got resolved, please let me know. It will be definitely helpful.

Thanks & regards,
Prasanna.

Eric
I have used the file upload form and registerd the multipart handler. The file uploads ok but when it returns to the HTML page it wants you to download the response
which is in the form of html tags within a body message. Is there a way to prevent
the pop up download message and have the response directly displayed on the HTML page?

Hi Albert,

This means the context type of the response is wrong. Add as a last sep in your upload service the service pub.flow:setResponse and change the input for contentType to text/html. You can add teh HTML response to the field “response”.