Get file name when upload error
See original GitHub issueI am curious, how the right way to get the file name from UploadServiceBroadcastReceiver.onError(UploadInfo, Exception). I can set the file name to UploadInfo.uploadId, and then get the file name from that uploadId, but i think that is a hacky thing. Is there any right way to do that?
Version info
- Android Upload Service version: any
- Android version and API version: any
- HTTP stack (e.g. HurlStack or OkHttpStack): any
What did you expect?
Method to get file name correctly
What happened instead?
Steps to reproduce (if applicable):
Library initialization code:
UploadService.NAMESPACE = BuildConfig.APPLICATION_ID;
Request code:
final MultipartUploadRequest multipartUploadRequest = new MultipartUploadRequest(this, mCurrentPhotoPath, url)
.addFileToUpload(uriToUpload.getPath(), "file")
.setNotificationConfig(getNotificationConfig(mCurrentPhotoPath))
.addParameter("some_parameter", "some_value")
.addHeader("some_cookie", "some_cookie_value");
.setMaxRetries(0);
multipartUploadRequest.startUpload();
Where have you added the request code?
- Activity
- Service
- Other class (add additional info about it)
LogCat output (please set log level to DEBUG first)
// your LogCat output here
Server side
Server log (if applicable)
Additional info
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Error: File upload failed. (file name) Invalid File Name
Answer: · Ensure you are logged into the Files Folder and are in the folder in which to upload the file. · In...
Read more >Get the filename of a fileupload in a document through ...
To get only uploaded file Name use this, fake_path=document.getElementById('FileUpload1').value alert(fake_path.split("\\").pop()).
Read more >Field('upload') : problem with file name - Google Groups
I have a problem with Field('upload). It seems that some file names produce an error in DAL. Let's take a "test" app to...
Read more >Working with Uploaded Files — CodeIgniter 4.2.10 ...
Each file can be moved to its new location with the aptly named store() method. ... By default, upload files are saved in...
Read more >FileUpload.FileName Property (System.Web.UI.WebControls)
The FileName property is used to get the name of the file to upload. ... all the necessary error checking that should be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
3.3 released and this feature is now available!
PR for retrieving the files left: #277