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.

Uploading file Not Working when file name contains Arabic numbers or characters

See original GitHub issue

Uploading file Not Working when file name contains Arabic numbers or characters. Please help me this is urgent!

fun attachMessageFile(attachRequest: AttachRequest, upload: UploadProgressListener?): Single<AttachMessageResponse> {
        return Rx2AndroidNetworking.upload(ApiEndPoints.ATTACH_FILE)
                .addHeaders(apiHeader)
                .addMultipartFile("file", attachRequest.file, ";charset=utf-8")
                .setContentType(";charset=utf-8")
                .addMultipartParameter("duration", attachRequest.duration)
                .addMultipartParameter("chat_id", attachRequest.chatId.toString())
                .addMultipartParameter("type", attachRequest.type.toString())
                .setPriority(Priority.HIGH)
                .build()
                .setUploadProgressListener(upload)
                .getParseSingle(object : TypeToken<AttachMessageResponse>() {})
    }

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
marab2commented, Mar 26, 2020

I’m one of your course Advanced Android Development members, I really enjoy it and please help me with this. We have the same problem as described our file name is “photo_۲۲۲.jpg” Please help us with solving this.

0reactions
MansourMcommented, Jul 3, 2021

Also had this problem, fixed it and sent a pull request #563 before it is committed to the main branch you can use this:

  1. Add it in your root build.gradle at the end of repositories:
	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
  1. Add the dependency implementation 'com.github.MansourM:Fast-Android-Networking:1.0.3'

  2. add encoding to your file uploads like this .addMultipartFile(KEY, FILE, CONTENT_TYPE, "utf-8")

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uploading file Not Working when file name contains Arabic ...
Uploading file Not Working when file name contains Arabic numbers or characters. Please help me this is urgent!
Read more >
When uploading Arabic files in Spring, filename ends up with ...
It's likely Spring which has transformed Unicode characters (at least, the non-ISO-8859-1 characters) into XML entities.
Read more >
File.getName() and File.list() can't read arabic????
It works fine except for one thing: files that have their names in arabic show up as question marks or other strange characters....
Read more >
Filename encoding and interoperability problems
Unfortunately, it's still possible that files uploaded / downloaded this way can have interoperability problems, for a number of reasons unrelated to gsutil....
Read more >
Uploading Files and Images - Caspio Online Help
Displaying and Downloading Files in Apps. When File fields are included on results or details pages of DataPages you have separate options for...
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