filestack-js icon indicating copy to clipboard operation
filestack-js copied to clipboard

Path in PickerStoreOptions gets URL escaped when saved to azure

Open GODBS opened this issue 5 years ago • 8 comments

We are currently integrating filestack with our application and we ran into this bug when trying to upload to azure storage:

Steps to reproduce:

<script type="text/javascript" src="https://static.filestackapi.com/v3/filestack.js"></script>
<script>
var client = filestack.init('TOKEN_HERE');
function showPicker(){
  client.pick({
    uploadInBackground: false,
    disableStorageKey:true,
    fromSources:['local_file_system','googledrive'],
    storeTo:{
      container:'global',
      location:'azure',
      path:'images/accounts/'
    },
    onFileUploadFinished: (response) => {
      console.log(response);
    }
  });
}
</script>
<input type="button" value="Upload" onclick="showPicker()" />

Upload any file from google storage

What is expected?

In browser's console the key should be logged without being URL escaped: [{ ..., "key":"global/images/account/filename.pdf", ...}]

You will get the expected result when uploading from "local_file_system" using V3 but not when using google drive. The key doesn't exist for local_file_system but in azure storage, the file is placed at the right location.

What is actually happening?

In browser's console the key is logged as URL escaped value: [{ ..., "key":"global%2fimages%2faccount%2ffilename.pdf", ...}]

In the azure storage explorer, the uploaded file does not appear at the right location, instead it appears on the root of the container with the name global%2fimages%2faccount%2ffilename.pdf

See image below: Screen Shot 2019-04-02 at 10 39 19 PM

GODBS avatar Apr 03 '19 02:04 GODBS

Hi Piter,

Any news on this one?

GODBS avatar Apr 27 '19 18:04 GODBS

Hi, change your path to: path:'/images/accounts/' Will work for version 2.x.x.

maryfs avatar May 07 '19 06:05 maryfs

I confirm it works with a '/' at the beginning of the path. Thank you

GODBS avatar May 07 '19 15:05 GODBS

I believe there has been a regression on this bug. I am having the same issue again with Azure Storage. Please view initial summary in order to reproduce with the '/' at the beginning of the path.

GODBS avatar Aug 24 '20 19:08 GODBS

Hi @GODBS , in which version?

maryfs avatar Aug 25 '20 05:08 maryfs

I've tried version 3.17.0 which is the latest i believe.

GODBS avatar Aug 25 '20 13:08 GODBS

Hi Mary,

Have you gotten any news on this?

GODBS avatar Sep 23 '20 18:09 GODBS

Hi @GODBS could you please contact our support to provide apikey, we need to check your app settings. I cant reproduce your problem on our accounts.

maryfs avatar Sep 30 '20 08:09 maryfs