Skip to content

Uploading a photo via share dialog from the phone should be not duplicate the photo #1626

Closed

Description

@goopen

Discussed behaviour

Uploading a photo via share dialog from the phone should be not duplicate the photo.

Current behaviour

Photos are copied regardless to "user@domain"-folder creating duplicates of said file on device.

Steps to reproduce

  1. Install owncloud android app 2.0.0
  2. Upload any photo from share dialog in a file manager of your choice
  3. Check gallery app and you will see that the file has been copied.

Environment data

Android version: 6.0.1
Device model: oneplus2
Stock or customized system: CM13
ownCloud app version: 2.0.0
ownCloud server version: 9.0.1

Please note

  • I did clear cache and uninstalled/reinstalled app again. Still happens. This issue was not present prior to version 2.0.0.
  • This issue does not occur on photos which gets uploaded via InstantUpload feature.

Kind regards

Activity

  1. goopen commented on Apr 22, 2016

    @goopen
    Author

    That's odd, must've been broken prior to 2.0.0 then? Because no duplicates where seen when uploading via share dialog, aka no duplicate files.

    Anyway, close thread if expected behaivor.

    Regards

  2. goopen commented on Apr 22, 2016

    @goopen
    Author

    Sounds like a plan, It could be old behavior reintroduced with the pull for improved upload handling.

  3. malkomich commented on Apr 25, 2016

    @malkomich
    Contributor

    This is a new behaviour that could be fine, because all the uploads are working this way, except the uploads done from external apps

  4. davivel commented on Apr 26, 2016

    @davivel
    Contributor

    As @LukeOwncloud said, that setting is about instant uploads only.

    About uploads shared from other apps: we discovered we need to make a temporary copy of the files shared from other apps in some circumstances. In those cases, we moved the temporary file after the copy to the OC folder.

    But as you notice, this results in a duplication of the local file that was not happening before. And probably we should have left it the way it was before.

    @goopen , if you rewrite the issue description without the references to the setting 'original file will be...', we can keep it to track the problem of unexpected duplication.

  5. tobiasKaminsky commented on Apr 26, 2016

    @tobiasKaminsky
    Contributor

    We have an option "move / copy" during upload from within our app.
    I thought that I had opened a PR for doing the same thing when sharing files from within another app.
    Of course this only works if the "file" to send is a real file on the device and not an e.g. cached file.

    Edit: There it is: #1542

  6. goopen commented on Apr 27, 2016

    @goopen
    Author

    @davivel I've edited the issue description to fit the wanted behaivor discussed here. Let me know if you want me to adjust anything.

    Regards

  7. tobiasKaminsky commented on Apr 29, 2016

    @tobiasKaminsky
    Contributor

    UploadFileOperation:720 -> sourceFile.delete() is not possible.
    sourcefile.canWrite() returns false.

    ContextCompat.checkSelfPermission(mContext, Manifest.permission.WRITE_EXTERNAL_STORAGE)
    while debugging returns 0 which says that the app is allowed to write.
    But still the file is not delete-able.

    I guess there is a big problem if android 6 (target 23) and photos on external sdcards are in use.

  8. davivel commented on May 24, 2016

    @davivel
    Contributor

    Thanks, @goopen, it's perfect.

    I guess there is a big problem if android 6 (target 23) and photos on external sdcards are in use.

    Right, but that's a different issue :)

    @rperezb , this would be easy to fix and sneak in the next bug-fixing release.

  9. 3 remaining items

  10. davivel commented on May 24, 2016

    @davivel
    Contributor

    Fixed in #1687.

    This was a bug I introduced in 2.0.0.

  11. changed the title [-]2.0.0 does not respect setting 'original file will be..'[/-] [+]Uploading a photo via share dialog from the phone should be not duplicate the photo[/+] on May 24, 2016
  12. self-assigned this
    on May 26, 2016
  13. davivel commented on May 27, 2016

    @davivel
    Contributor

    Ready to go in next release, coming very soon.

  14. CouchMaster commented on Aug 24, 2016

    @CouchMaster

    I am still experiencing this issue! Got a Sony Xperia Z5 Compact with Andorid 6.0.1 on it.
    I cleared the cache of the App (v2.1) and also reinstalled it, didn't helped.

    My OwnCloud Server is hosted on my external Webspace and I am still on v8.x

  15. davivel commented on Aug 26, 2016

    @davivel
    Contributor

    I made a fast test; can't see any duplication.

    Could you please describe the steps you followed to see the bug? For instance, what I did

    1. Opened FX File Browser and long-pressed a picture.
    2. Pressed on 'Share', then chose ownCloud in the list of apps.
    3. ownCloud app appears; I choose a folder to upload the picture and press button 'Upload'.
    4. ownCloud disappears (back to FX File Browser), the upload is triggered and ownCloud notification is visible in the status bar while uploading.
    5. Press 'HOME' button to leave file browser, then open ownCloud.
    6. Browse to the folder where the picture was uploaded, and don't touch it. The file is not downloaded (no green checkmark icon on the thumbnail) -> no duplication.
  16. CouchMaster commented on Aug 26, 2016

    @CouchMaster

    I am usually taking a different way to upload. The way you descriped is working for me, too. No Dubs.
    But when I do as follow, it dublicates the photos:

    1. Open OwnCloud App
    2. Select Folder where you want to upload the photo
    3. Press Plus-Symbol (right bottom) and then the Upload-Symbol
    4. Go to folder and photos and select them
    5. Press Upload (Bottom-Button)
    6. When it finished uploading check your File Browser for dublicates
  17. davivel commented on Aug 26, 2016

    @davivel
    Contributor

    In that case, between steps 4 & 5, change the radio button right above the "Upload" button; with the option "Move file" checked, the file will be taken from the original location into the local ownCloud folder. See that default selection is "Copy file", that duplicates the file.

  18. CouchMaster commented on Aug 28, 2016

    @CouchMaster

    Thanks! That was the case. So no bug, by Design, eh?

    It feels a bit misleading, because, as a Windows-User, I thought "move" means "Copy to Locaten A and delete from source" and "copy" means "copy to location A and leave original file".

  19. davivel commented on Aug 29, 2016

    @davivel
    Contributor

    So no bug, by Design, eh?

    Yes.

    It feels a bit misleading,

    Sorry for that, wasn't the idea :S . We had a long discussion about this somewhere in the repo, and what you see is the result of a commitment among different opinions.

    I thought "move" means "Copy to Locaten A and delete from source" and "copy" means "copy to location A and leave original file".

    It does so, but considering both source folder and target folder in the device (both local). For instance, with "Copy" a picture in your "/sdcard/emulated/0/Camera/" folder will be copied from there to "/sdcard/emulated/0/ownCloud/" folder and stay in both (duplication), but with "Move" the picture will be only available in "/sdcard/emulated/0/ownCloud/" and deleted from "/sdcard/emulated/0/Camera/" . In both cases the picture will be in the server also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions