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

fixed an upload issue when file name contains arabic/persian numbers #563

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MansourM
Copy link

@MansourM MansourM commented Jul 2, 2021

Hey man,
great library, i've been using it for some time and it made my life much easier :D

there was a tricky issue with file uploads, when there are arabic/persian numbers in file name (or maybe also some other languages)
the library wont upload the file as was stated in this issue](#491)
the thing that makes it extra tricky is the fact that you can have an image in your phone with the name "image123.png" when you upload the image on (EN) locale everything is fine, but if you change the Locale to Persian (FA), getting the file URI/name from android will return then name with Persian numbers, and even if you try to fetch the "image123.png" it cant find it, you need to use the name with pesian number :D, pretty weird ;D

the root of the problem was the fact that, okhttp header will not accept these numbers as valid characters for the header, i worked around it by URL Encoding the name and adding a new method that has an extra encoding parameter when making Multipart files.

it can probably be done in a cleaner way, ill leave that to you

Have a nice day.

@MansourM MansourM changed the title fixed upload issue when uploading files containing arabic/persian numbers fixed an upload issue, when file name contains arabic/persian numbers Jul 2, 2021
@MansourM MansourM changed the title fixed an upload issue, when file name contains arabic/persian numbers fixed an upload issue when file name contains arabic/persian numbers Jul 2, 2021
@MansourM
Copy link
Author

MansourM commented Jul 3, 2021

this seems to be addressed here and fixed here , and your are using 3.10 which is after this pull, not sure why its still giving us this error ;(

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

1 participant