cancel
Showing results for 
Search instead for 
Did you mean: 

Not getting correct mime type

Former Member
0 Kudos

Hi,

i am using a file upload UI element in which i have to restrict the files to upload based on file extension.

I am accessing the mime type. but for .exe files i am getting the mime type as application/pdf.

please suggest how can i get the correct mime type.

Regards,

Sanjeev

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

We are getting the mime-type as application/octet-stream when we are attaching the .tiff files. Plz suggest some way so that we can only be able to attach .tiff files and no other formats(like .dll, .exe etc.).

On debugging i found dat the method get_mime_type( ) of the class CL_WD_FILE_UPLOAD is yielding correct value image/tiff when i check for the same .tiff file on some other system.

Kindly let me know whether there are some pre-defined mime types present in the some system.

When we checked in our system it is yielding value as application/octet stream in our case for the same mime_type.

Former Member
0 Kudos

hi,

i think you need to look for a transaction which would would update the mime type table.

Former Member
0 Kudos

Sanjeev,

Try this:

Go to transaction SMW0 and choose u201CBinary datau201D option.

Press enter.

Maintain the MIME type (if youu2019ve not maintained yet) in menu Settings -> Maintain MIME types.

Regards,

Banu

gill367
Active Contributor
0 Kudos

For exe file the mime type will be APPLICATION/OCTET-STREAM

i guess there is somemismatch happening in your mapping.

check your code and binding onece again.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi,

Our requirement is to enable user to enter only pdf and tiff files.

But the mime type for .tif is coming APPLICATION/OCTET-STREAM and for .tiff is coming different.Is there any difference between the two?

The user is not able to attach .tif files.Any pointers.