Three types of uploads
There are three types of uploads possible: content, admin, and users. Access to each is controlled by a separate perm. There is an additional toggle for file uploads, controlled by the Site Control "allow_uploads". If this is unselected it will override any permissions and uploads will function at all.
Content uploads are for uploading files to special pages or stories. If the user has the perm "upload_content", they will have a new input box at the bottom of the submit story and special pages forms. If the user uploads a readable file, scoop will take the content of that file and place it in the content of the story or special page as if the user had typed it themselves.
User uploads are for allowing file storage on your server to the users of your site. If the user has the permission "upload_user", they will see an upload form appear at the address http://www.mysite.com/user/mynick/files, along with a listing of any files they have uploaded.
Administration uploads are for allowing a site admin to upload and manage files on their server from a web browser without requiring ftp. If the user has the permission "upload_admin", they will be see a list very similar to the user files list above, and be able to upload files to that areas.
Configuring File Uploads
Aside from the "allow_uploads" site control and the permissions outlined above, there are several other site controls that should be set in order for file uploads to work correctly. The site control "upload_user_quota" places a limit on how much disk space each user can take up, measured by KB.
The site controls beginning with "upload_path_" set the path on the filesystem that scoop will save the files to. These must be directories that exist, and must be writeable by the apache user. However, when a user uploads a file, scoop will create a subdirectory for each user using their user id number as the new directory name.
The site controls beginning with "upload_link_" set how scoop will link to the files once they are uploaded. This setting will depend on how your apache is configured, but it will be how apache views the path in the respective "upload_path_" site control. This is important for any of the functions that link to the file.
Additionally, you can configure scoop to allow a user to delete or rename files once they have been uploaded. Depending on your userbase you might want to prevent your users from doing this because it can break stories that use those files.
The user_files_list box
There is also a new box in scoop, the user_files_list box. If you place this box in your submit_template, you can use this to allow a convenient interface for users to insert IMG tags into their stories. If they have javascript enabled, the box will allow users to use a drop-down box to select an uploaded file, and press a button to insert the correct tag into the intro or body text of the story.
Future Plans
- integrate the files into the database in a table
- move images to another location when used in a story, and delete those images when story gets deleted.
- make the admin uploads more flexible so that it is possible to upload to multiple paths
- a way to move files between upload areas