Automatic daily download with username/password

Hi Experts,
I am a newbie with the nextcloud. The Nextcloud i have is V25 an an ubuntu jammy conatiner at an Qnap NAS 451+
It is running so far.
But i want to download some PDF in a nightjob or something an copy it in the specific folder.
On the download site you have to insert a username and a password and click on a Login-Button. Then, about 3-4 Seconds later there opens a window “Save as…” where you can give the foldername and save the PDF manually.
Is it possible to do that automatically?

Thanks in advance.


I understand that you want to get a file from somewhere on the internet and store it in your Nextcloud.

Under Linux (i.e. on your Nextcloud), you would use a CRON job, for example, which downloads the file into a folder of the Nextcloud via wget including the user data. In order for the file to be visible in the Nextcloud afterwards, you also have to perform occ files:scan.

There is also a Nextcloud app Transfer, but it is not supported in Nextcloud 25.

Sad that something like this with a little more functionality (e.g. CRON) is not standard. It is simply stupid if normal users have to take a diversion via the local computer when loading files from the Internet again up to Nextcloud. Absurd in the year 2023. File managers like Tiny File Manager implemented in one php-file including some CDNs has got this simple feature (Upload from URL). :wink:

The transfer and the ocdownload app doesn´t work unfortunately on my version 25.0.3. If the ubuntu system does the cron job via wget or curl: Where do i have to copy the file so that i can see it in the nextcloud?

You can copy the files to /path/to/nextcloud/data/username/files. After that you must execute:
sudo -u www-data php /path/to/nextcloud/occ files:scan --all
that Nextcloud knows the files. Instead of --all you can use the username.


Maybe you can better use External Storage.

OK Thank you. I will try.

That’s under the assumption that wget is able to perform a standard login to get access to the file. May or may not be the case.

1 Like