You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Files saved with S3Adapter: Content-Type not set in S3 #1900
I have set up the S3 FileAdapter using this guide.
I can successfully create files using new Parse.File("file.html", bytes, "text/html");
The files will appear in my S3 bucket, but with the Content-Type "text/plain" rather than "text/html" as expected.
parse-server 2.2.10
Edit: Also probably related to the same issue:
If I save a file without any extension, e.g. new Parse.File("photo", bytes);, .txt will be appended to the file's name. The file's key in S3 will look like 5658b255f1cb4413e6c84717adf79ebc_photo.txt. This behaviour was not present with hosted Parse.
The PR I have made should fix the content type not going through.
as for the .txt being added, it looks like if a content type is set to text/plain and it has no extension it will add the default extension, eg with text/html you will see filename similar to _photo.html
I am still new to node / npm. How would I go about using your PR branch before it's merged?
I have tried changing my dependencies so that parse-server uses your branch's URL (git://github.com/blacha/parse-server.git#bug/1900-file-content-type).
When I run npm install, it installs parse-server from your branch, but the lib/ directory is missing, indicating some script probably didn't run becaused I used a direct github URL. Is there something special I should do when using npm URL dependencies to make sur I end up with lib/ in place?
I am using latest parse server version and s3 direct access still facing the similar issue for example abc.jpg is renamed abc.jpg.txt when file is saved through web sdk.
Activity
blacha commentedon May 25, 2016
The PR I have made should fix the content type not going through.
as for the
.txtbeing added, it looks like if a content type is set totext/plainand it has no extension it will add the default extension, eg withtext/htmlyou will see filename similar to_photo.htmlpascalgiguere commentedon May 25, 2016
Thanks for the fix @blacha.
I am still new to node / npm. How would I go about using your PR branch before it's merged?
I have tried changing my dependencies so that
parse-serveruses your branch's URL (git://github.com/blacha/parse-server.git#bug/1900-file-content-type).When I run
npm install, it installs parse-server from your branch, but thelib/directory is missing, indicating some script probably didn't run becaused I used a direct github URL. Is there something special I should do when using npm URL dependencies to make sur I end up withlib/in place?Possibly linked to npm/npm#3055.
Thanks!
pascalgiguere commentedon May 25, 2016
npm issues aside (I found a workaround), I confirm your commit fixed the issue for me.
Fixing #1900 JS SDK file upload (#1935)
flovilmart commentedon Jul 13, 2016
Should be fixed now!
Please update to latest parse-server version and reopen if the issue persist.
Don't forget to include your current:
manishsangwan commentedon Dec 12, 2016
I am using latest parse server version and s3 direct access still facing the similar issue for example abc.jpg is renamed abc.jpg.txt when file is saved through web sdk.
flovilmart commentedon Dec 12, 2016
@manishsangwan what version of the SDK/parse-server are you using? Can you open a new issue and fill the issue template entirely?
manishsangwan commentedon Dec 14, 2016
@flovilmart client sdk developer is looking into it. Will surely create a new issue if unresolved. Thanx.