Home « Server software «
Documentation: files/edit.php
files/edit.php - Upload a new file or update an existing one
If no anchor has been provided to host the file, this script will create one. The title given for the file, or the file name, will be used as the page title. On direct uploads the sender will have the opportunity to select in which section the article has to be created. By default the article will be posted in the first public section appearing at the site map.Also, fully qualified href can be provided instead of real files, to create shadow entries linked to material posted elsewhere. For example, you can use these href to list within YACS files that are available at anonymous FTP servers.
On new file upload, the href field is always stripped.
This script accepts following situations:
- If a file has been actually uploaded, then search in the database a record for this name and for this anchor.
- If no record has been found and if an id has been provided, seek the database for the related record.
- If a valid record has been found, then update it.
- Else create a new record in the database.
An alternate link can be added to any file record, to better support P2P software (eMule, etc.)
This script attempts to validate the new or updated article description against a standard PHP XML parser. The objective is to spot malformed or unordered HTML and XHTML tags. No more, no less.
Restrictions apply on this page:
- uploads can have been administratively disallowed
- anonymous (not-logged) surfer are invited to register to be able to post new files
- members can post new files, and modify their files afterwards, if submissions are allowed
- associates and editors can do what they want
The active field is used to control the publication of uploaded files
- members uploads are flagged as being restricted; only other members can access them
- associates can publish member uploads by changing the active field
- associates uploads are flagged according to the input form
If the configuration enables it, associates can select to upload public files into some FTP space. In this case the active flag will take the value 'X'. Here are the rules used to take into account the fact that a file can not be transferred from the web to the ftp or vice-versa:
- on first upload, an associate can select between X, A, R or N
- else if X was used, stick on it
- else an associate can select between A, R or N
A button-based editor is used for the description field. It's aiming to introduce most common codes supported by YACS.
The edition time is not limited at all. Some Javascript code polls the server in the background to ensure that session data is not lost during all the time the browser window is opened.
Accepted calls:
- edit.php upload a file and create an article to host it
- edit.php/<type>/<id> upload a new file for the anchor
- edit.php?anchor=<type>:<id> upload a new file for the anchor
- edit.php/<id> modify an existing file
- edit.php?id=<id> modify an existing file
If the anchor for this item specifies a specific skin (option keyword '
skin_xyz
'),
or a specific variant (option keyword 'variant_xyz
'), they are used instead default values.This script is a reference file of this system.
Voir aussi:
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
- Vincent Noël
Testeurs:
- Natice
- Vincent Weber
- Manuel López Gallego
Reste à faire:
- do not change date if silent is checked
- allow for a move to another anchor (Lucrecius)
- on new file entry, cascade rights limitations from sections (Jan)
- if extension is not allowed, and if associates, add a shortcut to configuration panel for files