The MU forums have moved to WordPress.org

Trouble Uploading Files (17 posts)

  1. leviputna
    Member
    Posted 14 years ago #

    I know this question has been posted 100 times but I am having trouble uploading files.

    I am using wordpress mu 1.5.1 and have set my wp-content directory to have permissions 777 + have created an uploads folder under wp-content with permissions 777.

    Using the ‘add media’ tool in the write post tab, when I upload a file I get no errors however the file doesn’t upload, I get all the information about the photo but no photo itself. Do I need to change any other permissions?

  2. dsader
    Member
    Posted 14 years ago #

    With wpmu there is no need to create any "upload" folders or set any paths/perms. Folders are created automagically in the blogs.dir/"blog_id" directory.

  3. leviputna
    Member
    Posted 14 years ago #

    Ok part of my problem was that I was reading the documentation for single blog version of wordpress, however I am still having the same problem. The files are uploading properly. They get saved to - wp-content/blog.dir/blogs.dir/files/… but they're not appearing properly in the editor.

    This suggests there is a problem with my .htaccess

    This file looks line this

    Any suggestions what I am doing wrong?

    RewriteEngine On
    RewriteBase /

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ /$1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    Thanks,
    Levi

  4. lunabyte
    Member
    Posted 14 years ago #

    "They get saved to wp-content/blog.dir/blogs.dir/files/"

    Is that a typo, or do you actually have wp-content/blog.dir/blogs.dir/files/?

    It should be wp-content/blogs.dir/files/.

  5. leviputna
    Member
    Posted 14 years ago #

    Sorry that was a typo,

    Am example of the path actual file path is wp-content/blogs.dir/1/files/2008/06/thefile

    However the path in the add media window and in the post is /files/2008/06/demo.jpg

    I think there must be a problem with my uploaded files rewrite rules.

    Additionally http://<blogURL>/files/2008/06/demo.jpg doesn’t link to the file.

    any sugestions?

  6. fouad.fakhr
    Member
    Posted 14 years ago #

    i faced the same problem with custom fields when it requires the image path
    it only works when i type it as following http://doamin.com/wp-content/blogs.dir/1/files/2008/06/thefile
    the problem will be huge if you make it a single theme for all the users on the system which requires custom field "image" for example

  7. dsader
    Member
    Posted 14 years ago #

    Try a refresh or different permalink structure in options/settings->permalink.

  8. Farms
    Member
    Posted 14 years ago #

  9. leviputna
    Member
    Posted 14 years ago #

    I cannot even view the image detectably, if I view http://clubsdotcom.com/wp-content/blogs.dir/1/files/2008/06/mu-header-logo.png the image still doesn’t display. However if I download the image via FTP it is ok????

    It has me stumped.

  10. thommeredith
    Member
    Posted 14 years ago #

    leviputna:

    I just recently updated to 1.5.1 and i was having the same problem, my htaccess file did not have this (from your post above)

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    now, I can see the file, thanks

  11. thommeredith
    Member
    Posted 14 years ago #

    Wait, I can see the file, but for some reason not the thumbnail or medium file, possibly due to the hyphen?

  12. leviputna
    Member
    Posted 14 years ago #

    thommeredith: did you end up getting your thumbnails working? My problem seems to be with the wp-content/blogs.php not construction the file properly.

    all that is returned is a few nonsensical symbols. is there anyone that knows much about this file that can help me out. From what I understand this problem is caused by the file header information not being sent properly.

  13. musnake
    Member
    Posted 14 years ago #

    I got the thumbmnails to display in the media manager by moving the

    '#uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]'

    code higher up in my .htacess file...

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ /$1/ [R=301,L]
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    The path to the file still displays as http://mydomain.tld/files/yy/mm/image.jpg which will be a problem when users need to cut and paste the path to images for the template's custom fields...

    The image does display in the post (so .htacess rewrite works).

    I'll have to load up the exact same file name from a different blog to test it later :)

  14. wehican
    Member
    Posted 14 years ago #

    Does WPMU do the graphics rendering by itself or does it need some support on the host server?

  15. musnake
    Member
    Posted 14 years ago #

    Rendering? As in recompiling an image based on a change in some attribute such as resolution or dimension? A PHP image manipulation library such as imagemagik or GD would probably be invoked by the code author to do that kind of work.

    Apache would serve up the image...based on path/permission information that it is fed from various sources (which is where the host server settings come into play).

    Not sure what you mean :)

  16. wehican
    Member
    Posted 14 years ago #

    :-)

    What I mean is since he can upload it but it doesn't show up that there may be a problem with server support for the graphics?

    I dunno.

  17. musnake
    Member
    Posted 14 years ago #

    If he's using cPanel, sometimes, the 'prevent hotlinking of images' magic is too strong.

About this Topic

  • Started 14 years ago by leviputna
  • Latest reply from musnake