Files Are Not Uploading
This article covers many reasons why your users are not able to upload media (images, music, video) files and how to fix them.
Solution
-
1
PHP configuration directive "memory_limit" is not big enough
The PHP core takes up about 5MB. You also need at least 4 bytes for each pixel in the image to resize it, regardless of the actual file size. So, if you have a 2000x2000 pixel (4 megapixel) image, you need memory_limit at least this big to be able to upload it: 5MB + ( 2000 * 2000 * 4B ) = 21MB
If the memory_limit directive is not big enough, the upload will fail. There are many online resources describing how to increase memory_limit in PHP. Please search online for "increasing memory_limit in php" or contact your web hosting provider for more information.
-
2
PHP configuration directive "safe_mode" is set to on
Safe mode can prevent PHP from writing to the temporary upload folder (upload_tmp_dir). This can cause uploads to fail. To fix this problem, you should ensure that PHP safe_mode is set to "off". If you are unsure about how to do this, contact your web hosting provider for more information.
-
3
PHP configuration directive "open_basedir" is set incorrectly
This issue can completely prevent PHP from writing to any folder not within the directories (or their subdirectories) specified by the directive. As such, the "open_basedir" directive must either be set to off, or must include the temp directory (PHP directive "upload_tmp_dir") and your web server's document folder (i.e. "/var/www/htdocs"). Note that subfolders of the specified settings can be written to, i.e."open_basedir /tmp:/var/www/htdocs" includes the folder "/var/www/htdocs/social". If you are unsure about how to do this, contact your web hosting provider for more information.
-
4
PHP configuration directive "file_uploads" is set to off
This directive must be set to "on" to allow any file uploads. If you are unsure about how to do this, contact your web hosting provider for more information.
-
5
PHP configuration directives "upload_max_filesize" or "post_max_filesize" are not set large enough
This commonly results in the error message "filetype is not allowed". These directives must be set to at least what you have set in the SocialEngine control panel, or larger files will fail to upload. If you are unsure about how to do this, contact your web hosting provider for more information.
-
6
PHP configuration directive "upload_tmp_dir" is set incorrectly or is inaccessible
The directive "upload_tmp_dir" specifies the folder in which uploads are stored temporarily. It must be a folder that's accessible by PHP. If unset, the default is generally the system temp directory which is a system environment variable (TMP and TEMP are two possibilities). If you are unsure about how to do this, contact your web hosting provider for more information.
-
7
The uploads folder is not accessible
The uploads folders in the SocialEngine root directory must be writable (aka have full permissions set).
Linux: You must chmod 777 the folder (recursive)
Windows: You must set "Full Control" on the folder for the user group "Everyone" (recursive)
-
8
Incorrect extension/mime type
Make sure the file extension and MIME types are properly set in the admin panel. Often a file type has more than one possible mime type, so make sure they are all in the admin panel.
Here are some commonly used file formats and their corresponding MIME type(s):
Extension Type/sub-type Audio aifc audio/x-aiff aiff audio/x-aiff au audio/basic m3u audio/x-mpegurl mid audio/mid mp3 audio/mpeg ra audio/x-pn-realaudio ram audio/x-pn-realaudio rmi audio/mid snd audio/basic wav audio/x-wav Compression gtar application/x-gtar gz application/x-gzip lha application/octet-stream lzh application/octet-stream tar application/x-tar tgz application/x-compressed z application/x-compress zip application/zip Documents c text/plain css text/css doc application/msword dot application/msword h text/plain hlp application/winhlp htm text/html html text/html htt text/webviewhtml js application/x-javascript mdb application/x-msaccess pdf application/pdf rtf application/rtf rtx text/richtext txt text/plain xla application/vnd.ms-excel xlc application/vnd.ms-excel xlm application/vnd.ms-excel xls application/vnd.ms-excel xlt application/vnd.ms-excel xlw application/vnd.ms-excel Images bmp image/bmp gif image/gif ico image/x-icon jfif image/pipeg pe image/jpeg jpeg image/jpeg jpg image/jpeg tif image/tiff tiff image/tiff xbm image/x-xbitmap xpm image/x-xpixmap Programs bin application/octet-stream dll application/x-msdownload exe application/octet-stream sh application/x-sh Video asf video/x-ms-asf asr video/x-ms-asf asx video/x-ms-asf avi video/x-msvideo, video/avi mov video/quicktime movie video/x-sgi-movie mp2 video/mpeg mpa video/mpeg mpe video/mpeg mpeg video/mpeg mpg video/mpeg mpv2 video/mpeg qt video/quicktime swf application/x-shockwave-flash -
9
Your web server or client connection is slow and it never finishes or times out (larger files)
Uploading large files can be tricky sometimes. The best fix for now is to increase your max timeout and upload the file over a reliable internet connection.
Open a Support Ticket
You have been successfully subscribed to our newsletter!
Join our Facebook group
Follow us on Twitter