Support

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
    aifcaudio/x-aiff
    aiffaudio/x-aiff
    auaudio/basic
    m3uaudio/x-mpegurl
    midaudio/mid
    mp3audio/mpeg
    raaudio/x-pn-realaudio
    ramaudio/x-pn-realaudio
    rmiaudio/mid
    sndaudio/basic
    wavaudio/x-wav
    Compression
    gtarapplication/x-gtar
    gzapplication/x-gzip
    lhaapplication/octet-stream
    lzhapplication/octet-stream
    tarapplication/x-tar
    tgzapplication/x-compressed
    zapplication/x-compress
    zipapplication/zip
    Documents
    ctext/plain
    csstext/css
    docapplication/msword
    dotapplication/msword
    htext/plain
    hlpapplication/winhlp
    htmtext/html
    htmltext/html
    htttext/webviewhtml
    jsapplication/x-javascript
    mdbapplication/x-msaccess
    pdfapplication/pdf
    rtfapplication/rtf
    rtxtext/richtext
    txttext/plain
    xlaapplication/vnd.ms-excel
    xlcapplication/vnd.ms-excel
    xlmapplication/vnd.ms-excel
    xlsapplication/vnd.ms-excel
    xltapplication/vnd.ms-excel
    xlwapplication/vnd.ms-excel
    Images
    bmpimage/bmp
    gifimage/gif
    icoimage/x-icon
    jfifimage/pipeg
    peimage/jpeg
    jpegimage/jpeg
    jpgimage/jpeg
    tifimage/tiff
    tiffimage/tiff
    xbmimage/x-xbitmap
    xpmimage/x-xpixmap
    Programs
    binapplication/octet-stream
    dllapplication/x-msdownload
    exeapplication/octet-stream
    shapplication/x-sh
    Video
    asfvideo/x-ms-asf
    asrvideo/x-ms-asf
    asxvideo/x-ms-asf
    avivideo/x-msvideo, video/avi
    movvideo/quicktime
    movievideo/x-sgi-movie
    mp2video/mpeg
    mpavideo/mpeg
    mpevideo/mpeg
    mpegvideo/mpeg
    mpgvideo/mpeg
    mpv2video/mpeg
    qtvideo/quicktime
    swfapplication/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.

Latest News

More from around the web