parse-community / parse-community/parse-server

Upload files in folder with S3 adapter

Open
#6,534 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

Hello,

I know that uploading a file on a specific folder with S3 file adapter is not correctly/fully handled with Parse.Server. I've read that all files are uploaded at the same bucket level.

However, i've uploaded a file manually in a folder in a S3 bucket. Example bucket>folder>myfile.png.
I have set with Mongo manually a parse file field on my object. (MyObject.picture = "folder/myfile.png"
When i'm trying to view this file from the file controller it doesn't works correctly.

http://localhost:1337/api/files/local_app_id/folder/myfile.png -> doesn't work :
{ "error": "unauthorized" }
http://localhost:1337/api/files/local_app_id/folder%2Fmyfile.png
It works !

Do you know how can I fix this or am i missing something ?

Thanks a lot

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the file controller and reproduce the two requests shown: the unencoded folder path and the encoded folder%2F path. Trace how each route resolves S3 object keys and authorization, then verify that an S3 file stored under folder/myfile.png can be retrieved through the intended URL form.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, node.js
Domain
api, backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.