cancel
Showing results for 
Search instead for 
Did you mean: 

Upload JPG Image with Mimetype to KM using FileUpload

Former Member
0 Kudos

Hi Everyone!

I have developed a wd application which makes a upload files to KM. We have configurated the KM repository for that the images can be seen in miniatures. For that, we need to set the mime type when make the upload. It works fine for .gif images, but not for jpg or jpeg.

When I ask for see the image's details in KM, I can see that for jpg image, the mimetype set is "Binary file (application/octet-stream)" and for gif image, it's image/gif. Why am I getting application/octet-stream mimetype for JPG images? My code is:

IWDResource resource = wdContext.currentContextElement().getResource();

InputStream input = resource.read(true);

ICollection folder = (ICollection) getResource(wdContext.currentContextElement().getPathFolder());

Content content2 = new Content(input, resource.getResourceType().getHtmlMime(), input.available());

resource.getResourceType().getHtmlMime() is the code I have used for get the Mimetype.

Does anybody have any idea what is wrong?

Regards!

Luiza

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello.

I think this blog explains file uploading and downloading pretty good.

/people/bertram.ganz/blog/2007/05/25/new-web-dynpro-java-tutorials--uploading-and-downloading-files-in-sap-netweaver-70

Regards, Mikael