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.

Get file name when upload error

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
gotevcommented, Jul 30, 2017

3.3 released and this feature is now available!

0reactions
PhilLabcommented, Jun 21, 2017

PR for retrieving the files left: #277

Read more comments on GitHub >

github_iconTop 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 >

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