qoomon / aws-s3-bucket-browser

Single page application to browse AWS S3 bucket content
https://qoomon.github.io/aws-s3-bucket-browser/index.html?bucket=https://s3.amazonaws.com/spacenet-dataset#
MIT License
246 stars 85 forks source link

%2F delimeters in href #38

Closed reqlez closed 1 year ago

reqlez commented 2 years ago

I'm getting %2F delimeters generated in the path to the file, like:

root%2Fanotherfolder%2Ffile.jpeg instead of root/anotherfolder/file.jpeg

This is making the browser save the file as "root_anotherfolder_file.jpeg" filename instead of "file.jpeg" filename.

Can this be controlled somewhere? I saw another site with an older version, where it's as what i'm trying to get, but seems latest version is different? or am i missing something?

qoomon commented 2 years ago

You're right these delimiters %2F could and should be replaced by just /, however I can't reproduce the wrong behavior in Chrome browser. What browser do you use? I'll try to fix it anyway, because it looks ugly also on chrome :-)

qoomon commented 2 years ago

On safari I can reproduce your issue.

qoomon commented 2 years ago

I fixed it, please try again

reqlez commented 2 years ago

Oh wow, I was not watching this ticket since i did not think you would get back to me so fast!

Thanks! That was the fix! Working great now :)

PS: I was using Firefox on Linux.

korhox commented 1 year ago

Hi!

I have the same issue in version 1.9.2. I'm on macOS (M1 + Ventura beta) and the issue is between all browsers (Safari, Chrome & Firefox)

Offtopic: This is so far the Best and the simplest s3 browser I've ever used.

qoomon commented 1 year ago

Hi @korhox thanks for reporting.

Unfortunately I'm not able to reproduce this behaviour.

Could you provide an example href value? The only possible reason I can imagine is that encodeURI('foo/bar') behaves different, maybe you can run this code in your browser console an check the output. The expected result should be foo/bar.

korhox commented 1 year ago

Hello!

Here's a screenshot from the inspector:

image

And weirdly enough, encodeURI('foo/bar') works as excepted:

image
korhox commented 1 year ago

I went through your code, it seems you are using encodeURIComponent instead of encodeURI. I changed this to encodeURI on my end and now it works.

image
qoomon commented 1 year ago

oh :-) you're not using the latest version 1.10.1 https://github.com/qoomon/aws-s3-bucket-browser/blob/master/index.html