WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Media uploader problems on a password protected site (7 posts)

  1. marky
    Member
    Posted 6 years ago #

    Hello all,

    First, I love the new version of WordPress; it's going swimmingly, aside from one small issue that I'd like to report. (I've created a Trac ticket, but thought I'd post it here too just in case someone has any other insights.)

    I password protect my wp-admin directory using standard HTTP auth for an added level of security. I love the new media uploader included with WordPress 2.5, but it fails for the first upload in each session, possibly because of this password protection.

    Here's how the problem manifests itself:

    When I select a file with the new media uploader, a small dialog appears, prompting me for the username and password. I enter this information and press OK. Everything appears to have worked normally, but then it turns out that the file was not successfully uploaded. WordPress will behave as if it had worked (showing a blank image in the media browser, along with the relevant title and description information), however, the actual image file will not be there.

    The solution is to do delete the half-created media entry, and upload the media a second time, now that the username and password had been previously entered. This will work for all subsequent uploads until the next session.

    It's only an annoyance right now, but it would be nice to not have to go through the process of uploading everything twice when I write a post. If anyone has any ideas or insights, I'd much appreciate it. Thanks!

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Turn off the password protection. The uploader cannot deal with that.

    No other workaround at present, unfortunately.

    If you know how to disable the protection specifically for the "async-upload.php" file, then that should work as well.

    I *think* that adding a FilesMatch around your Require in the .htaccess would work. Like this:

    <FilesMatch "!async-upload\.php$">
     Require valid-user
    </FilesMatch>
  3. marky
    Member
    Posted 6 years ago #

    Thanks for the tip regarding async-upload.php, Otto42.

    Sadly, the FilesMatch didn't seem to work (password protection was disabled completely when I tried it), but I'll investigate this some more tomorrow.

    In the meantime, if anyone happens to know the right .htaccess magic offhand, I'd definitely appreciate it. :-)

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Well, searching tells me that apparently FilesMatch is too stupid to deal with negatives correctly.

    Try this workaround I found and modified:

    <Files "*">
    Require valid-user
    </Files>
    
    <FilesMatch async-upload.php>
    Allow from all
    Satisfy any
    </FilesMatch>

    Note that this must be in the wp-admin folder.

  5. mccormicky
    Member
    Posted 6 years ago #

    Otto42...that caused a 500 error.Are you sure that this is correct?
    Until I can get a fix I have come up with a stupid workaround for a password protected site.
    I upload images in IE7 then I switch to FF and am able to insert the images.Can't actually insert images into posts in IE7,though.But at least IE will upload them.
    I know it isn't WP 2.5 fault or because of any of that Apache hoo ha or PHP5 whiffle because I have 3 other installs on the same server but outside the protected directory and I can upload images just fine in FF or IE.
    I tried every single one of the .htaccess tricks presented by a variety of members in a variety of threads,disabled all my plugins,turned permalinks back to default,can't update Flash because I already have the most recent flash plugin installed...in short I tried everything.The only way I can upload in my preferred browser(FF) is if I turn off .htaccess and then turn it back on when I'm done uploading.But I can't do that because someone could see the protected site while I am editing.
    So that is my predicament. Switching back and forth from IE7 to FF --it's clunky but it works for now.

    The error log shows the problem is that asyncupload.php gets tacked on to the end of my login script resulting in a 404,naturally, because both files are in totally diff. directories.
    Ok I will shut up now.

  6. mccormicky
    Member
    Posted 6 years ago #

    Note to self:read sticky before opening big mouth.The new files for IE fixed the problem. At least now I can insert images and upload in IE. Too bad FF can't work,yet but I don't mind being uncool as long as I can get my work done. Can this be listed as resolved?
    Thanks Otto42!

  7. djsteve
    Member
    Posted 5 years ago #

    well I gave the above htaccess add into the wp-admin folder, and I still can not get it to work :(

    has anyone else come up with a fix for this?

    issue the way I see it:

    when I click on picture upload, then select files, I can select pictures to upload, but after a picture is selected, both firefox and Internet Explorer immediately ask for a username and password. So I have attempted to enter that information, and then also attempted to add that info and select the checkbox for IE and firefox to remember that info, yet it still seems to hang and fail no matter what.

    I did manage to get an error code from internet explorer once:
    --------------------

    Line: 1
    Char: 128
    Error: 'SWFUpload_0' is undefined
    Code: 0
    URL: http://www.mywebsite.com/blog/wp-admin/media-upload.php?post_id=image&flash=1

    -----------------------

    This problem only occurs with the "flash uploader" - the browser uploader option does not cause this problem.. but we need to use the flash uploader, as it is the only way to select and upload multiple pictures with wordpress, and we have hundreds of photos to upload this way.

    Your help is greatly appreciated!

Topic Closed

This topic has been closed to new replies.

About this Topic