Is there a difference ein upload from Android App and Browser/Client?

Hi there!
I am facing a strange behaviour. Maybe you can help me out on this:

A have written a bash script for my nextcloud instance. It is working more or less like this:

  1. Incron triggers flock- n ./mysrcipt
  2. Script converts,renames etc. files in a given nc folder (convert and cp)
  3. .occ rescan files of the folder

The script works perfectly on KDE Neon (Client Version 3.10.1 (KDE)) via the Client and the Browser.

But if I upload pictures from my android phone the creation date is set to the current day of this upload event no matter the exif date.

So I am wondering, if the file upload from android devices (also from the android browser) is different than that of the Computers? Is there some *.part file or other transferfile created which has creation date “currentday”?

With your script, you cannot use the webdav interface directly? This way you avoid to rescan the folder which is not recommended. If you don’t want to use the webdav interface, you can use a different location in the server to do the upload and then use the external storage feature to use this storage within Nextcloud.

The official clients and the browser all use the webdav backend and this should be identical. Exif information is meta data within in the file, the creation date of a file is the date on the file system, such dates can differ also if a client changes the date (e.g. you can imagine clients if they copy a file to a remote storage that they either keep the current creation date on their own system or use the transfer time as creation date.

I moved the topic to the android section, they should know the default behaviour of the android client.

Hm thanks for your reply and moving it!

If i understood you right, i think i have to clear a little bit:

I am not running the script client-side but server-side, so I don´t know how to use webdav here?

The sript is fired up each time incron triggers (which means a file is created within the nextcloud-data folder) and the www-data user executes the scrip…

How would webdav help here?

As to your second point:

This is exactly what makes me wonder about the different devices. Within the script the date of the uploaded file is read like this:

#!/bin/bash

dateformat=+"%Y"-"%m"-"%d"
function creation_date() {
  if [[ -z $(exiftool -DateTimeOriginal "$f" | xargs | cut -d " " -f 4) ]]; then
    cdate="$(date -r "$f" $dateformat)"
    echo "$cdate --> Date Date"
  else
    cdate="$(exiftool -DateTimeOriginal "$f" | xargs | cut -d " " -f 4 | tr : -)"
    echo "$cdate --> Exif Date"
  fi
}

of course the function is called on other places within the full script. But in the end it comes down to:
If the exiftool shows no date, then take the creation date of the file (via the date -r command)

That is why I am wondering

If you are server side, you could use webdav as well (even though it seems a bit complicated). The cleaner way is using the workflows. Now, you can even use non-php scripts:

Wow thanks - I just posted some questions about this yesterday. Would it be possible to run bash script within the workflow like this?

./myscript %n

Sorry! All back … I just forgot to install exiftool on the server :see_no_evil: – embarrassing …
Now it works perfectly!

… But beside does anyone if the workflow can handle bash scripts?