-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uploaded filenames are getting saved with incorrect prefix #2415
Comments
a possible alternate fix might be to provide a user configurable option to include/exclude the '-' dashes that make the code look like a uuid. |
folks, this is a bigger issue than just a truncated name in the dashboard. can we get some consensus on a direction forward please? |
The issue raised here seems quite clear and I'm inclined to agree it should be fixed in Parse Server. Can you submit a PR? |
Closing as released part of 2.2.20 |
Issue Description
When a file is uploaded from the Dashboard for a Class with a File column, the saved filename is different to what Parse.com produces and consequently the client applications such as the Dashboard displays a truncated version of the filename.
Steps to reproduce
curl -X GET -H "X-Parse-Application-Id: 00000" -H "X-Parse-Master-Key: 11112" -H "Content-Type: application/json" http://localhost:1337/parse/Classes/Customer
Note the filename: fcb209ccfab5b87912c61cd32b2ac47f_LICENSE.txt
Result is:
Note the filename: tfss-59be62cc-7cc0-4aec-9618-ecb2df31f734-LICENSE.txt
As you can see, the random string prefix in the Parse.com version has got the dashes.
When the Dashboard reads the name value, it uses an offset (i.e. 37 or 42 depending on whether the filename starts with tfss- or not) to extract the original uploaded filename. Because of the missing dashes, this results in a truncated filename for display.
The display issue can be easily fixed in the Dashboard, but it is best fixed in the Server as other clients such as Mobile apps using the SDKs are probably experiencing the same issue.
Expected Results
filename: LICENSE.txt
Actual Outcome
filename: NSE.txt
Environment Setup
Logs/Trace
You can turn on additional logging by configuring VERBOSE=1 in your environment.
Not applicable
Suggested Fix
One fix would be to save the files with dashes in the filename. I have tested this and seems to work. Happy to send a PR for review.
Related Issue
Pull Request
The text was updated successfully, but these errors were encountered: