S3 javascript file metadata set incorrect

Advertisement

MZPE
Guest

S3 javascript file metadata set incorrect

Hello!

I was attempting to use WinSCP to send some files to S3 storage and noticed that the content-type for my *.js files was set to
binary/octet-stream
instead of the expected
application/javascript
(which is how Amazon's S3 web interface treats *.js files).

Is this possibly a limitation in the MIME Type API that WinSCP is using? (https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms775147(v=vs.85)#known-mime-types)

I noticed a related fix here: https://winscp.net/forum/viewtopic.php?t=25765 which is what lead me to find that API page.

I would be happy to offer more details or do some testing if this is indeed an issue within WinSCP.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,567
Location:
Prague, Czechia

Re: S3 javascript file metadata set incorrect

I have MIME type text/plain configured for .js files:

[HKEY_CLASSES_ROOT\.js]
@="JSFile"
"Content Type"="text/plain"

And WinSCP correctly uses that for S3.

Check, what's your settings.

Reply with quote

MZPE
Guest

Thanks Martin, I had no idea that's how the MIME type was determined :-)

It appears that nothing was specified in the registry for .js files:



After adding a "Content Type" value it now works as expected!

Thanks again!

Reply with quote

Advertisement

You can post new topics in this forum