Batch Upload

Batch upload method make possible direct import of files from within the server without using a front web interface. If you and your users can use FTP or SFTP or SSH you can use the batch upload feature.

 Can handle large files
The Batch Upload imports the files directly from the local file system and is thus not affected by regular upload limits. As a result large files can be imported into the File Galleries. Use "Store in directory" as File Gallery storage if you are going to import large files.

Setup Steps

Setup Tiki File Gallery to store files in the Directory, and not in the database.
It is safer to create your file directory outside the web space of your server (outside www).

Step2 - Establish a batch upload directory

You should have a dedicated folder to perform batch upload. While you can have it inside your Tiki directory it is advised to have it outside the www folder (like where should be your files folder if you store your file in a directory; see Admin=>File galleries panel).

Set the appropriate permission chmod 755 or 777 (depending on the provider)

Step3 - Activate batch upload directory

Go to the File Galleries panel http://example.com/tiki-admin.php?page=fgal
Enable the Batch uploading option (first tab, scroll about a bit more than half way down)
Type/paste in the path of your batch upload directory the path (absolute or relative).

Use Steps

Step1 - FTP/FTPS/SFTP/upload files from client to server in your batch upload directory

Step2 - Batch upload from server to Tiki

Go to the file gallery you want to import files in and click on the button "batch"
Tick the appropriate files, choose the file-gallery to store the file into, check the name and subdirectory options per your need and apply.

You should see a success message and your file list left with the files you didn't select for batch upload. (empty if you selected them all).

If you do not want to give users the FTP-login for the batch folder just create FTP-subfolders inside your main batch directory folder:
/user1 /user2 etc.

Then you or anybody who has login to the main directory can simply FTP-move the FTP-uploaded files from the users-subfolder into the batch folder and then batch-upload them from inside Tiki

Console Command

As of Tiki 15 there is a console command so you can set a scheduled batch upload cron task

Example command line usage
Copy to clipboard
# file according to sub-directory name and create missing galleries php console.php files:batchupload 1 --subdirToSubgal --createSubgals # file according using sub-directory with integer name into gallery with corresponding ID php console.php files:batchupload 1 --subdirToSubgal --subdirIntegerToSubgalId # set file user etc so apache can manage the files afterwards php console.php files:batchupload 1 --fileUser apache --fileGroup allusers --fileMode 0775 # upload files from a different directory php console.php files:batchupload 1 --filesPath /var/www/other/uploads # more help php console.php help files:batchupload


Related:


Alias names of this page:
batchupload | batchfileupload | batch file upload