Support » Fixing WordPress » Upload.php href not including script name on IIS

  • I have a server with several different versions of WP running on it. All of the standard WordPress files are intact.

    Basically, the problem I am experiencing is that all of the links within the upload.php do not reference the file upload.php. They all end up as “/wp-admin/?query=string&for=upload&is=here”. This is not happening on other installations, including WP 2.2.

    Could it be that something introduced between 2.2 and 2.3 would have caused this?

    This is not a permissions problem. I have no problem uploading diles. I just have trouble doing things with them because I cannot get beyond the initial upload.php page (everything else goes to the admin index).

    SERVER: Windows 2003/IIS 6

Viewing 12 replies - 1 through 12 (of 12 total)
  • Alright… it’s been a week, so I figure that if I’m ever to get a response, I should let a fresh pair of eyes take a look.




    Alright, the problem is still present in WP 2.3.1 and nobody has responded to this post.

    Is there some additional information needed? This is a pretty mission critical problem as I cannot adequately manage uploads.

    Did I post in the wrong place? Someone at least reply!



    Basically I can’t get my head around your problem. But I’m not very experienced so that might be it.



    Latest WordPress version. I did not (and do not) have this problem with WordPress 2.2 on the same server.

    On /wp-admin/upload.php, there is no reference to upload.php in any link on the page.

    Incorrect behavior (what I am seeing):
    <a href="http://domain/wp-admin/?action=edit&ID=13">

    Correct behavior:
    <a href="http://domain/wp-admin/upload.php?action=edit&ID=13">

    upload.php is has a function called clean_url() that is not returning the correct prefix for the url string of upload.php.

    its not the clean_url I just commented it out “$_href = clean_url( $href);” in the upload.php file and was able to see the link with the correct url, but when clicked nothing happens. Interestingly enough if I open the page for example “upload.php?style=inline&tab=browse-all&post_id=2&_wpnonce=bac8d5d2fc&ID&action&paged” browse content comes up fine. I found another post saying that you had to make a default doc of upload.php be at a higher position than index.php, but that just renders the dashboard on entrance useless.

    I replaced the clean_url line and replaced with the following:
    //$_href = clean_url( $href ); // <– This does not work on Windows
    //$BH_temp = explode(“?”, clean_url( $href ));
    //$href = ‘upload.php?’ . $BH_temp[1];
    $_href = $href;

    That works far enough to display the first page of uploads but when you want to browse to a second page the string “uploads.php” has once again disapered from the href.

    Sorry the code should be:

    //$_href = clean_url( $href ); // <– This does not work on Windows
    $BH_temp = explode(“?”, clean_url( $href ));
    $href = ‘upload.php?’ . $BH_temp[1];
    $_href = $href;

    I now got the paginating to work with a realy ugly hack:

    $page_links = paginate_links( array(
    //’base’ => add_query_arg( ‘paged’, ‘%#%’ ), // <– This does not work on Windows
    ‘base’ => ‘upload.php?style=inline&tab=browse-all&paged=%#%’,

    The only problem with this one is that when you browse to, for example, page 2 of the uploads the tab “Upload file” dissapears.

    If there’s someone who have greater knowledge of WP and how it’s build up this bug shouldn’t be to hard to fix. Alla that happens is that it doesn’t write out the part of the string that is most fundamental “upload.php”.

    I have posted a hacky fix for WP 2.3.3 here:

    that fixes the upload bug that causes the wordpress admin page to open in the frame that should contain the upload window.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    It’s not an upload bug, it’s an IIS bug. You would not see this problem on Apache.

    Anyway, the true fix is here:

    That will not only fix this issue, but issues with any script using the REQUEST_URI field.

    Thanks for that. I ment it was a bug to do with upload.php not being properly referenced by IIS.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Upload.php href not including script name on IIS’ is closed to new replies.