-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Upload failed: could not be copied to owncloud local directory #101
Comments
Could you tell us what model is your device? |
HTC Desire (the original) |
I've experienced the sdcard fs being remounted as read-only sometimes with my old Wildfire. Can other applications write to the sdcard just fine? |
No problems with sdcard. besides that is where the pictures I want to upload are located :-) |
Could you download files with the ownCloud app? Please, check if they are located into the 'ownCloud' directory in your SD Card. |
No problem downloading, just pulled down a 5MB high-res picture on the phone. |
Does the fail occur always, or just when the device is connected to the computer through USB? How much space do you have free in the SD card? |
I did obviously not try with the device connected as there would be no access to the SDcard. |
Sorry, I did not mean to be patronizing. Some times obvious things are not so obvious for everybody. Could you tell me what is the version of Android in your device, and if it stock or customized? It can be a problem with the method used to ask for the remaining space in disk. |
No problem. |
same problem here. |
Any news on this? |
Sorry, not yet. We tried to reproduce it with some 2.2 devices, but seems it is something more specific. We are very busy with some other improvements right now. Probably we will not be able to work in this until the end of the week. |
I succeded in uploading files when accepting to move the file to the owncloud folder. |
Yes, we think it is a problem with the implementation of the class http://developer.android.com/reference/android/os/StatFs.html in some devices. We use it in Android 2.2 systems because this http://developer.android.com/reference/java/io/File.html#getUsableSpace() is available only from Android 2.3. The most anoying part is that StatFs is working fine in our 2.2 test devices... |
So what to do? |
ping :-) |
And suddenly it works after having wiped my Owncloud server and reinstalled 4.8... Was an update rolled out? |
The instant upload of pictures taken with the camera does still not work. should I file a seperate report? |
The version of owncloud I had reinstalled was 4.5.8 not 4.8 |
@pascalBokBok , sorry for the lack of responsiveness. I am very happy to read that you can upload, because we found no way to reproduce this in our 2.2 devices, or in emulators. About the instant uploads issue, it is something different and well known. It is already reported here : #6 . It is probable that we finally solve it really soon. @bigmarinz, could you tell us if this problem is still alive for you? |
Seems the main problem is inactive now. Pending problems are in other issues, such as #6 . |
I'm getting this problem on Moto X, Android Version 4.4. When I try to upload a file from the phone's "Downloads," this error is produced in the notification bar. In other words, I go to the Downloads app. Then, I long hold a file I wish to upload to bring up the share icon. I press the share icon and choose ownCloud, and finally choose a directory on my ownCloud drive. It won't upload the file. OC server is OC 8.0.1 on Ubuntu. I can successfully upload a file from the Google Drive app to ownCloud. Also, I was able to make a new folder. |
I've reproduced this issue in Android Studio on an emulated device running android-19. |
You are right. |
For some reason, the download app Intent object is passing the wrong path to the local file: public int onStartCommand(Intent intent, int flags, int startId) { At least this is what I have been able to uncover from one night of debugging. Regards, |
It seems the bug is actually in uploadFiles() from Uploader.java. For a PDF, Uri.decode(uri.toString()) does not actually provide the localPath to the file. Also, for an Image file, i.e. mimeType.contains("image"), the columns projection do not match for the URI: content://com.android.providers.downloads.documents/document/. Thus, ownCloud crashes when trying to upload an image from the Downloads app, because localPath ends up being null in obtainNewOCFileToUpload from FileUploader.java. I added some logging statements while trying to upload a pdf file:
These printed:
I added this code to the else statement that catches content that is not an Image, Audio, nor Video:
This was the output:
|
This works to upload a file from the downloads app by changing the else statement that catches content that is not an Image, Audio, nor Video:
See jksinton@1ba1dfe This uses some of the Storage Access Framework taught by Paul Burke at http://stackoverflow.com/questions/19834842/android-gallery-on-kitkat-returns-different-uri-for-intent-action-get-content Mr. Burke commented that a more up-to-date version is here: This works to upload content that is not an image, video, or audio file, e.g. a word doc or a pdf. We may need to add similar if-else statements that determine if the file is from the downloads app, e.g.:
using this:
If we want to upload an image, video, or audio from the download app. |
Is this still valid? |
Looks like the if else branch for an image, video, audio is incorporated in Uploader.java. I just tested an image and pdf file. They uploaded. We can probably close this issue. |
I'm using v. 1.9.1 with server 8.2.2 stable. I was able to upload zip and apk files from the downloads app. |
@jksinton is this still a problem? |
No reaction, closing. Please comment/reopen when you have information including newest version feedback. Thanks! |
I cannot upload files.
It may be because my phone's internal memory does not have so much space left. But 14MB should be enough for a photo.
My SD card has lots of space.
The text was updated successfully, but these errors were encountered: