Original file path gets URL escaped when uploading a file from Dropbox
See original GitHub issueWe are currently trying to migrate to V3 but stumbled upon this bug.
Steps to reproduce:
Use Filestack’s snippet (modified to also allow uploading from Dropbox):
<script type="text/javascript" src="https://static.filestackapi.com/v3/filestack.js"></script>
<script>
var client = filestack.init('TOKEN_HERE');
function showPicker() {
client.pick({
fromSources: [ "local_file_system", "dropbox" ],
maxFiles: 5,
}).then(function(result) {
console.log(JSON.stringify(result.filesUploaded));
});
}
</script>
<input type="button" value="Upload" onclick="showPicker()" />
- Create test file
"Folder name/File name.pdf"
in Dropbox - Upload
"Folder name/File name.pdf"
from Dropbox
What is expected?
In browser’s console the originalPath
should be logged unchanged: [{ ..., "originalPath":"/Folder name/File name.pdf", ...}]
You will get expected result when uploading from "local_file_system"
using V3 (same as the path
parameter when uploading a file using V2).
What is actually happening?
In browser’s console the originalPath
is logged as URL escaped value: [{ ..., "originalPath":"/Folder%20name/File%20name.pdf", ...}]
UPDATE:
Similar issue happens when uploading from OneDrive. But in that case the originalPath
is even more cryptic: [{ ..., "originalPath":"/folder.2125c39d19ca7b4f.2125C39D19CA7B4F%21105/file.2125c39d19ca7b4f.2125C39D19CA7B4F%21106", ...}]
.
It would be nice to have originalPath
as original human readable "Folder name/File name.pdf"
wether it’s uploaded from local file system or from any of cloud providers.
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (9 by maintainers)
Top GitHub Comments
@velveteer Thanks for quick response! As I’ve said in V2 the path from Dropbox wasn’t escaped, that’s why I expected the same behavior from V3 as well.
I’m not sure if the original names the Filestack client V2 was returning from Dropbox were intentional or not, but we used those names to create exactly the same file structure for uploaded files.
It looks like having
originalPath
(or some other key) to work consistently across cloud providers would be a great feature to have.Closing this. We are running
0.9.0
in production and it works great so far.