The MU forums have moved to WordPress.org

viewing uploaded pics (32 posts)

  1. comforteaglespaceman
    Inactive
    Posted 18 years ago #

    I've uploaded some files thought the blog upload page... I've pasted the html it gives me to post it to a blog post, but the url must be wrong: http://steve.geoblogz.com/files/7.jpg

  2. Falo
    Member
    Posted 18 years ago #

    I`ve got the same problem. I think it's a rewrite issue...

  3. jaseone
    Inactive
    Posted 18 years ago #

    Try this, edit your .htaccess, find the existing line for wp-includes/images and below it paste:

    RewriteRule ^([_0-9a-zA-Z-]+)/files/(.*) /files/$2 [L]

    That is assuming your upload directory is set to yourwwwroot/files, there might be an easier way to exclude URI's from the rewrite instead of just rewriting them to themselves though.

  4. jaseone
    Inactive
    Posted 18 years ago #

    Just had a well duh moment.... Follow the instructions at http://mu.wordpress.org/forums/topic/226 to put a .htaccess in the files directory to turn the Rewrite engine off for that directory. Although how that works for multiple users is beyond me... I haven't really delved into how that is handled but I assume there is code to virtualize the default /wp-inst/wp-content/images per user or something similar.

  5. comforteaglespaceman
    Inactive
    Posted 18 years ago #

    bump.

  6. Falo
    Member
    Posted 18 years ago #

    ...this works for me:

    RewriteRule ^([_0-9a-zA-Z-]*)/?files/(.*) /wp-inst/wp-content/blogs/$1/files/$2 [L]

    RewriteRule ^([_0-9a-zA-Z-]*)/?wp-content/blogs/(.*)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$3 [L]

  7. comforteaglespaceman
    Inactive
    Posted 18 years ago #

    That works sweetly! Gracias

  8. flungster
    Inactive
    Posted 18 years ago #

    Hi, I've tried to use the above hacks to my .htaccess file and they just don't seem to work. Here's the URL to a test picture:
    http://members.urbanslate.com/flung/files/Picture081WinCE.jpg

    unfortunately no picture comes up - the blog comes up instead so I know the .htaccess is rewriting the URL. Any thoughts? Anyone else having problems with upload that can't seem to be solved by the above hacks? I'm now using the 9/16 build but still no go. :( Thanks folks!

  9. codesmith
    Inactive
    Posted 18 years ago #

    <<bump>>

    using the 9/20 build and this is still a problem. uploaded a file (image.jpg) and that seems correct - it goes to:
    .../domain.com/httpdocs/wpmu/wp-inst/wp-content/blogs.dir/3/files/image.jpg

    but it gives me:
    http://www.domain.com/wpmu/blogname/files/image.jpg

    which gives a url not found in browser. must be a rewriterule problem but my brain hasn't figured out all that stuff yet...

    (this is using subdirectories, not subdomains by the way)

  10. flungster
    Inactive
    Posted 18 years ago #

    Well I did some investigation and debugging, and I finally fixed my problems although there was some hacking of the source code to make it work.

    First off, the .htaccess files in:
    /wp-inst/
    and
    /wp-inst/wp-content
    use a ForceType option to tell Apache to treat the blogs file found in /wp-inst/wp-content/ as a PHP file. Unfortunately, my ISP does not use the naming convention used in the default .htaccess file. So I had to modify it to:
    <Files blogs>
    ForceType x-mapp-php4
    </Files>

    or

    <Files wp-content/blogs>
    ForceType x-mapp-php4
    </Files>
    depending on which .htaccess file you're working with.

    So that was problem number one. Another problem I had was that my ISP does not use PHP as a module on Apache. Thus, the call to apache_request_headers() did not work at all. I had to comment out the line and comment out the code that used the $headers (so no caching tricks for me). Oh well.. once I did that everything was fine for me.

    Thus I would first check to see if your blogs file is being processed as a PHP file on your server. If it isn't - then maybe you have to change your .htaccess files. Hope this helps.

  11. codesmith
    Inactive
    Posted 18 years ago #

    I think the post above at Posted: 2005-09-21 07:13:10 is miscategorized. Not having a problem with viewing blogs - it's viewing images that is the problem.

  12. flungster
    Inactive
    Posted 18 years ago #

    Oh.. actually it's not. In order to view images, the blogs php script is called to help wordpress figure out which directory the file is actually stored in. If the blogs script isn't being executed, you're not going to be able to see the image at all.

  13. partypageusa
    Member
    Posted 18 years ago #

    I use the following and it doesn't work for me. The link just get redirected to http://domain.com/500/

    RewriteRule ^([_0-9a-zA-Z-]*)/?files/(.*) /wp-inst/wp-content/blogs/$1/files/$2 [L]

    RewriteRule ^([_0-9a-zA-Z-]*)/?wp-content/blogs/(.*)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$3 [L]

  14. skybinary
    Inactive
    Posted 18 years ago #

    add in .htaccess
    RewriteRule ^files/(.*) /wp-inst/wp-content/blogs/$1 [L]

    I think:
    default htaccess setting is :
    http://domain/user_id/files/file_name
    but that's I want to show:
    http://user_id.domain/files/file_name

  15. partypageusa
    Member
    Posted 18 years ago #

    Anyone getting this error in there error log?

    error: file has no execute permission: (/home/host/public_html/wp-inst/wp-content/blogs)

    anyone know what this means?

  16. lynk
    Member
    Posted 18 years ago #

    thanks flungster for pointing me in the right direction.

    the code for the apache_request_headers should be changed to something like this in the core:

    if (function_exists('apache_request_headers')) {
    $headers = apache_request_headers();
    }
    else{
    $headers = '';
    }

    is there a svn/source for the mu edition, couldn't find it on trac?

  17. fredl
    Member
    Posted 18 years ago #

    I've modifified my .htacess but nothing is working at all, i can't display the loaded picture...
    I've inserted all the rewrite rules, nothing is working

    RewriteRule ^files/(.*) /wp-inst/wp-content/blogs/$1 [L]
    RewriteRule ^([_0-9a-zA-Z-]*)/?files/(.*) /wp-inst/wp-content/blogs/$1/files/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]*)/?wp-content/blogs/(.*)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$3 [L]

    thansk for helping !

  18. jfitzell
    Inactive
    Posted 18 years ago #

    Yes, the default rewrite rules don't seem to work if you have wildcard DNS set up... once those are changed it worked fine on one server and not on another. Turned out the difference was that you may need this Apache directive:

    AcceptPathInfo On

    This is required, otherwise Apache will look at the rewritten url wp-inst/wp-content/blogs/1/etc... and complain because there is no directory called blogs/ With this directive turned on, apache will look backwards up the URL until it finds a part of it that matches. I added this to wp-inst/wp-content/.htaccess and I can now view uploaded files just fine.

  19. partypageusa
    Member
    Posted 18 years ago #

    When I added this line
    AcceptPathInfo On
    onto the wp-inst/wp-content/.htaccess file, the template is all mess up.

    What else did you change besides that line?

  20. BeOne
    Inactive
    Posted 18 years ago #

    Hello, maybe it can help someone ) It works for me.
    Replace this ones
    RewriteRule ^([_0-9a-zA-Z-]+)/files/(.*) wp-inst/wp-content/blogs/$1/files/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+)/wp-content/blogs/(.*)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$3 [L]
    With those
    RewriteRule ^([_0-9a-zA-Z-.]*)/?files/(.*) /wp-inst/wp-content/blogs.php [L]
    RewriteRule ^([_0-9a-zA-Z-.]*)/?wp-content/blogs/(.*)/files/(.*) /wp-inst/wp-content/blogs.php [L]

    Rename blogs to blogs.php, ├?┬░nd check that function apache_request_headers() in blogs.php work for your.

    Have a nice day )

  21. pumpkinslayer
    Member
    Posted 18 years ago #

    Absolutely fabulous, after much frustration, the post by "BeOne" above works for all of my subblogs and main blog.

  22. vCarey
    Member
    Posted 18 years ago #

    My old .htaccess file was bad and wouldn't let my change anything or change its permission. I deleted it and made a new one using the above. It helped solve a lot of problems but now I can't view pics. I have done all of the above but still no pics.

    I don't know if this has to do with anything but the "file" folder and "2005" folder won't let me change permissions ('550 Could not change perms on 2005: Bad file descriptor'). And I can't delete them either. I can't even open the "2005" folder -- ftp locks up. And I get: '550 Can't change directory to /public_html/pewnet/wp-inst/wp-content/blogs.dir/4/files/2005: Permission denied'

    Any ideas? I'm open to trying just about anything -- you know, short of standing on my head.

    Thanks in advance for any help.

  23. Invizz
    Inactive
    Posted 18 years ago #

    try to chmod 2005 folder manualy through ftp manager

  24. vCarey
    Member
    Posted 18 years ago #

    I went into file manager in CPanel and it (the file itself) won't let me change permissions, open the file, or delete it. Trying to open the file sends me to my root directory -- before public_html.

    (sigh)

  25. Invizz
    Inactive
    Posted 18 years ago #

    this maybe problem with cpanel, try to do it with ie Far or Total Commander

  26. vCarey
    Member
    Posted 18 years ago #

    I used Total Commander -- same thing.

    I think it has something to do with .htaccess.

    I created a new blog, uploaded a pic, and the newly created 2005 folder is doing the same thing: "Permission Denied"

    Heck, if I can get this to work I'm pretty much all set.

  27. zeug
    Member
    Posted 18 years ago #

    RewriteRule ^([_0-9a-zA-Z-]*)/?files/(.*) /wp-inst/wp-content/blogs/$1/files/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]*)/?wp-content/blogs/(.*)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$3 [L]

    followed by renaming blogs to blogs.php works for me ... finally. What else references blogs, anyone know? Any known side effects from renaming it?

  28. mediast
    Member
    Posted 18 years ago #

    This worked for me too... Unfortunately, the drag and drop function does not appear to work...

  29. zeug
    Member
    Posted 18 years ago #

    Upload and drag n drop are working fine here, at least on Firefox 107. I'm using the 6/11 nightly and am wary of updating since everything seems to be settling down a bit. Still, renaming blogs to blogs.php seems a bit of a hack to me, but if it works for the moment...

  30. mediast
    Member
    Posted 18 years ago #

    I guess IE is the problem...:

    http://mu.wordpress.org/forums/topic/436

    Unfortunately, at least 75% of the world still uses IE.

    Nick

About this Topic

  • Started 18 years ago by comforteaglespaceman
  • Latest reply from adangvu1972