Skip to content

Files saved with S3Adapter: Content-Type not set in S3 #1900

Description

@pascalgiguere

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.

Activity

  1. blacha commented on May 25, 2016

    @blacha
    Contributor

    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

  2. pascalgiguere commented on May 25, 2016

    @pascalgiguere
    Author

    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-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?

    Possibly linked to npm/npm#3055.

    Thanks!

  3. pascalgiguere commented on May 25, 2016

    @pascalgiguere
    Author

    npm issues aside (I found a workaround), I confirm your commit fixed the issue for me.

  4. added a commit that references this issue on May 31, 2016
  5. flovilmart commented on Jul 13, 2016

    @flovilmart
    Contributor

    Should be fixed now!
    Please update to latest parse-server version and reopen if the issue persist.

    Don't forget to include your current:

    • node version
    • npm version
    • parse-server version
    • any relevant logs (VERBOSE=1 will enable verbose logging)
  6. manishsangwan commented on Dec 12, 2016

    @manishsangwan

    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.

  7. flovilmart commented on Dec 12, 2016

    @flovilmart
    Contributor

    @manishsangwan what version of the SDK/parse-server are you using? Can you open a new issue and fill the issue template entirely?

  8. manishsangwan commented on Dec 14, 2016

    @manishsangwan

    @flovilmart client sdk developer is looking into it. Will surely create a new issue if unresolved. Thanx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions