Installing files using FTP or SCP

Some servers do not allow files to be uploaded through a web interface. Or which forbid the uploading of particularly large files using such a mechanism. And even when you can do this, it can be a very slow process doing so. SPIP allows you to bypass these limitations by installing files used for images and documents by using FTP or SCP.

Of course, this operation is restricted to users who have access codes to the HTTP servers’ disks.

-  The upload folder

The location of the folder where you need to place the files depends on the status of the site and the version of SPIP that is installed. Prior to SPIP 1.9, this folder was the upload sub-folder inside the root ecrire directory, and SPIP would only show the contents of this directory to the site’s principal administrators. From SPIP 1.9 onwards, the upload folder is a sub-folder of the root tmp directory, but is still called upload and SPIP will only show all of its contents to the site’s principal administrators (those nominated as having "webmaster" privileges. But in addition to that, there is also a facility to have as many sub-folders as there are restricted administrators, with the names of these folders being the login names of those administrators. For each restricted administrator, SPIP will only show the contents of the folder with the matching name.

After installing your files by uploading them with FTP or SCP, make sure that they are read accessible by the HTTP server (both the folders and the files stored in those folders).

-  The drop-down files menu

Having done that, a drop-down menu appears automatically after the interface of web files uploading and displays the files contained in this folder. You only have to select the file that you need and validate your choice. Note that SPIP will only display the files known to be safe, which excludes any files not stored with the correct MIME filename extensions, especially those that have no extension at all. You can work around this restriction by using one of the permitted file extensions (e.g. rename x.php as x.txt), which allows you to load the file in place while still preventing that file being used in an abusive manner on the site. You can then use the document’s description form to indicate what the file’s correct original name used to be.

Using this menu, you can then select the file that you want and validate your selection.

If the operation succeeds, remember to delete the file from the /ecrire/upload folder (the system has created a copy of this file in another location on the server, so your original file is therefore not needed any more) to avoid overloading the drop-down menu with entries that are no longer necessary.

-  All the files at once

If you want to install several files at once in the /ecrire/upload folder, an additional feature is available for you on the site interface: you can install all these files in one batch. This can prove to be very practical to create large portfolios very quickly.

Collections of images and documents

You can easily add a collection of images and documents in one go by uploading a zip archive containing all of the documents in question.

SPIP will then suggest adding this archive "as-is" to the article (i.e. as a zip file) or to extract the archive to attach its contents to the article, or even to do both at the same time. If the operation you choose is to unzip the archive, then of course the same file exclusion mechanisms as described above still apply to limit the potential danger of any member files. You can additionally request that the name of each file be automatically recopied as the name of the document thereby attached to the SPIP object in question.