Skip to content
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

Added URL decoding to fix #249 #435

Closed
wants to merge 1 commit into from
Closed

Added URL decoding to fix #249 #435

wants to merge 1 commit into from

Conversation

rrkpp
Copy link

@rrkpp rrkpp commented Jan 4, 2015

Added URL decoding before file upload to avoid
System.IO.PathTooLongException when using the URL uploader with an
encoded string

Added URL decoding before file upload to avoid
System.IO.PathTooLongException when using the URL uploader with an
encoded string
@Jaex
Copy link
Member

Jaex commented Jan 4, 2015

Your code can stuck in loop forever.

@Jaex Jaex closed this Jan 4, 2015
@rrkpp
Copy link
Author

rrkpp commented Jan 4, 2015

Sorry, under what use case could an infinite loop occur? Just so I don't make the same mistake again. Thanks

@Jaex
Copy link
Member

Jaex commented Jan 4, 2015

Also doing loop like that can be problem like if file name is %50.jpg then it will decode it too, isn't it?

@rrkpp
Copy link
Author

rrkpp commented Jan 4, 2015

As far as I can tell it's impossible to support multi-encoded URLs while simultaneously protecting against pseudo-encoded file names. Either you loop to support multiple encoding and break files like %50.jpg or you give up the ability to decode URLs that have been encoded multiple times. By definition %50.jpg is an encoded URL which makes it virtually impossible to detect as being a decoded string. I think Unicode filenames like the G+ example and multiple encoded strings which are widespread on many hosts are a more popular use case than %50.jpg style names.

@Jaex
Copy link
Member

Jaex commented Jan 6, 2015

I was wrong about infinite loop sorry.

But I don't think url decoding download path is good idea. File name was from url so I will just url decode url first then get file name from it to make download path so won't need second url decoding.

Edit: Actually url decoding for url is not required at all? Just file name decoding for download path is needed for issue #249

Edit2: Fixed issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants