question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Original file path gets URL escaped when uploading a file from Dropbox

See original GitHub issue

We 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()" />
  1. Create test file "Folder name/File name.pdf" in Dropbox
  2. 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:closed
  • Created 6 years ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
vlazarcommented, Jun 14, 2017

@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.

0reactions
vlazarcommented, Sep 18, 2017

Closing this. We are running 0.9.0 in production and it works great so far.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The /upload behavior has been changed - Dropbox Community
Solved: Recently, we received many feedbacks from our product users that the filename (use /upload) has become garbled. We found the "path" decode...
Read more >
HTTP - Developers - Dropbox.com
As with content-upload endpoints, arguments are passed in the Dropbox-API-Arg request header or arg URL parameter. The response body contains file content, ...
Read more >
Types Of File Preview Errors And How To Handle Them
If you're seeing a message that says File is uploading, it's because the file hasn't finished syncing to Dropbox. A file must be...
Read more >
Fix syncing problems in Dropbox
1. On your computer, click the Apple menu (Apple icon) in the top left corner of your screen. 2. Click System Preferences. 3....
Read more >
What's a conflicted copy? - Dropbox Help Center
Once you're done editing, you can move the file back into its original location. Alternatively, here are a few other tips you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found