StatusNet 0.8 and later support uploading files as attachments to notices.
The user experience
|When composing a notice, click the paper clip icon to add an attachment...|
|This'll launch a file picker dialog. Pick the image file you wish to attach.|
|The selected file is now listed below the notice composition area -- you're ready to send!
If you change your mind, you can remove the file by clicking the "x" next to it before you send the message.
|When you send the message, the attachment is uploaded to the server, and a shortened URL to it is appended to your notice text.
Within StatusNet the attachment link will be marked with a paper clip icon to indicate that it's a special attachment; it'll be just a plain link when bridged to most other networks such as Twitter.
The Facebook bridge will show a thumbnail.
|When someone clicks on the attachment link within the StatusNet web interface, a lightbox will pop up with the image and a full URL which can be cut-and-pasted.
The lightbox is built via oEmbed, and in theory allows nice similar view embedding for remote links to other sites as well, where supported.
Under the hood
Attachment processing currently can happen in two code paths:
Per-user quotas are enforced at upload time, via checks in File::isRespectsQuota().
- file_quota (max size per file) default 5,000,000 bytes
- user_quota (lifetime max per user) default 50,000,000 bytes
- This sounds a little harsh... how could a user expand their quota over time? --brion 17:24, 11 October 2009 (UTC)
- monthly_quota (monthly max per user) default 15,000,000 bytes
Uploaded files have their content-types checked via the PEAR::Mime_Type module (which uses the file command as its backing -- configurable via $config['attachments']['file'] to change from default /usr/bin/file). Only files matching whitelisted MIME types are allowed through.
Types allowed by default:
Attachments don't get properly added to the notice text if you have disabled automatic URL shortening in your account preferences.
Buggage with Internet Explorer has been reported.
- http://status.net/trac/ticket/1826 (possibly fixed?)
- http://status.net/trac/ticket/1831 - Attachment not cleared from form after sending a notice in IE 8
Common problems with uploading:
- Make sure the
filesubdirectory is writable by the user the web server runs as (the installer should check for this)
- Check php.ini for PHP configuration settings...
file_uploads(should be 'On')
upload_tmp_dir(system default temp dir or one that exists and is writable to web server)
safe_modeprobably needs to be off
- http://status.net/trac/ticket/1787 - Attach File Fails (missing /usr/bin/file)
- http://status.net/trac/ticket/1739 - Not uploading attachments
- http://identi.ca/conversation/17247553#notice-17254885 - Someone should mention somewhere that 'other media types' need to be enabled before uploading anything (apologies for the bad formatting, I'm new here).