android-upload-service: Error During upload
hi, am trying to upload mp4 file from device storage but am keep geting error the code am using is
UploadService.NAMESPACE = BuildConfig.APPLICATION_ID;
final String uploadID = UUID.randomUUID().toString();
final String serverUrlString = "http://xxyyzz.com/mmff/upload.php";
try {
new MultipartUploadRequest(context, uploadID, serverUrlString)
.addFileToUpload(Environment.getExternalStorageDirectory().getAbsolutePath() + "/file2.mp4", "your-param-name")
.addHeader("your-custom-header-name", "your-custom-value")
.addParameter("your-param-name", "your-param-value")
.setNotificationConfig(new UploadNotificationConfig())
.setMaxRetries(2)
.startUpload();
} catch (Exception exc) {
Log.e("AndroidUploadService", exc.getMessage(), exc);
}
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 21 (9 by maintainers)
i found th eproblem, the php file path for the server was wrong, but i didnt get any error related to the server path, now am getting upload completed successfully but i cant find the file in the server, am using the folowing code in my php script
<?php $file_path = "uploads/"; $file_path = $file_path . basename( $_FILES['uploaded_file']['name']); if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path)) { echo "success"; } else{ echo "fail"; } ?>