Professional Web Applications Themes

#26326 [Opn->Fbk]: File upload wont work if spaces not in the right place. - PHP Development

ID: 26326 Updated by: [email]sniperphp.net[/email] Reported By: jnixon at postregister dot com -Status: Open +Status: Feedback Bug Type: Apache2 related Operating System: Linux PHP Version: 4.3.3 New Comment: And what exactly do you have in the extra.php script?? Previous Comments: ------------------------------------------------------------------------ [2003-11-19 18:35:24] jnixon at postregister dot com Description: ------------ I'm new at sending out these things, so please be patient. The problem I am having is with the file upload in apache 2.0.45, and mod_php 4.3.3 Works fine under *nix, it is the Microsoft Windows people I'm having the problems with. I bereave it has to do with the ...

  1. #1

    Default #26326 [Opn->Fbk]: File upload wont work if spaces not in the right place.

    ID: 26326
    Updated by: [email]sniperphp.net[/email]
    Reported By: jnixon at postregister dot com
    -Status: Open
    +Status: Feedback
    Bug Type: Apache2 related
    Operating System: Linux
    PHP Version: 4.3.3
    New Comment:

    And what exactly do you have in the extra.php script??



    Previous Comments:
    ------------------------------------------------------------------------

    [2003-11-19 18:35:24] jnixon at postregister dot com

    Description:
    ------------
    I'm new at sending out these things, so please be patient.
    The problem I am having is with the file upload in apache 2.0.45, and
    mod_php 4.3.3

    Works fine under *nix, it is the Microsoft Windows people I'm having
    the
    problems with.

    I bereave it has to do with the spaces in the name.

    If the name of the file has no spaces, than the location must not have
    any spaces.

    If the name of the file has a space or more in the name then the
    location
    doesn't matter.

    Examples:
    Does not work: C:\Doents and Settings\username\Desktop\image.jpg

    Works: C:\Doents and Settings\username\Desktop\image name.jpg
    Works: C:\image name.jpg
    Works: C:\image.jpg
    Works: C:\images\imagename.jpg

    I'm tying to upload a file using.
    <form ENCTYPE="multipart/form-data" action="extra.php" method="POST">
    Upload an image: <input name="userfile" type="file" size="100">
    <input type="submit" value="Send File">
    </form>

    If the file looks like this:
    C:\Doents and Settings\username\Desktop\image.jpg

    I have submited an bug report with apache and they said it was not a
    problem with apache.

    Reproduce code:
    ---------------
    <form ENCTYPE="multipart/form-data" action="extra.php" method="POST">
    Upload an image: <input name="userfile" type="file" size="100">
    <input type="submit" value="Send File">
    </form>

    Expected result:
    ----------------
    Netscape gives an error of "The doent contains no data".
    In IE I get the page cannot be displayed error.




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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=26326&edit=1[/url]
    sniper@php.net Guest

  2. #2

    Default #26326 [Opn->Fbk]: File upload wont work if spaces not in the right place.

    ID: 26326
    Updated by: [email]sniperphp.net[/email]
    Reported By: jnixon at postregister dot com
    -Status: Open
    +Status: Feedback
    Bug Type: Apache2 related
    Operating System: Linux
    PHP Version: 4.3.3
    New Comment:

    Replace that script with this:

    <?php

    var_dump($_FILES);

    ?>

    And post the output here (when you upload the problem file to it)



    Previous Comments:
    ------------------------------------------------------------------------

    [2003-11-19 18:54:38] jnixon at postregister dot com

    if ($_POST["MAX_FILE_SIZE"] != "")
    {
    $error = "";
    if ($_FILES['userfile']['name'] == "")
    {
    $error = "Please choose an image.";
    }
    elseif ($_FILES['userfile']['size'] > $_POST["MAX_FILE_SIZE"])
    {
    $error = "Image is to large, the image must be less then 5MB";
    }
    elseif ($_FILES['userfile']['type'] == "image/jpeg")
    {
    $uploaddir = '/var/www/postregister/ad/classadimages/';
    $uploadfile = $uploaddir. $_FILES['userfile']['name'];

    if (move_uploaded_file($_FILES['userfile']['tmp_name'],
    $uploadfile)) {
    $fileUpload = 1;

    $mySql = "Select * from Classifieds.UpLoadImages where
    SessionID = '" . $sessId . "' and ImageName = '" .
    $_FILES['userfile']['name'] . "'";
    //echo $mySql . "<br>";
    $myResult = mysql_query($mySql) or die("UpLoadImages Select:
    Invalid query: " . mysql_error());
    $myCount = mysql_num_rows($myResult);

    if ($myCount == 0)
    {
    $mySql = "Insert into Classifieds.UpLoadImages
    (SessionID,ImageName) values ('". $sessId . "','" .
    $_FILES['userfile']['name'] ."')";
    //echo $mySql . "<br>";
    mysql_query($mySql) or die("Sub Cat Invalid query: " .
    mysql_error());
    }

    } else {
    $fileUpload = 0;
    }
    }
    else
    {
    $error = "Image must be a JPEG, ie: imagename.jpg";
    }
    }

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

    [2003-11-19 18:38:22] [email]sniperphp.net[/email]

    And what exactly do you have in the extra.php script??


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

    [2003-11-19 18:35:24] jnixon at postregister dot com

    Description:
    ------------
    I'm new at sending out these things, so please be patient.
    The problem I am having is with the file upload in apache 2.0.45, and
    mod_php 4.3.3

    Works fine under *nix, it is the Microsoft Windows people I'm having
    the
    problems with.

    I bereave it has to do with the spaces in the name.

    If the name of the file has no spaces, than the location must not have
    any spaces.

    If the name of the file has a space or more in the name then the
    location
    doesn't matter.

    Examples:
    Does not work: C:\Doents and Settings\username\Desktop\image.jpg

    Works: C:\Doents and Settings\username\Desktop\image name.jpg
    Works: C:\image name.jpg
    Works: C:\image.jpg
    Works: C:\images\imagename.jpg

    I'm tying to upload a file using.
    <form ENCTYPE="multipart/form-data" action="extra.php" method="POST">
    Upload an image: <input name="userfile" type="file" size="100">
    <input type="submit" value="Send File">
    </form>

    If the file looks like this:
    C:\Doents and Settings\username\Desktop\image.jpg

    I have submited an bug report with apache and they said it was not a
    problem with apache.

    Reproduce code:
    ---------------
    <form ENCTYPE="multipart/form-data" action="extra.php" method="POST">
    Upload an image: <input name="userfile" type="file" size="100">
    <input type="submit" value="Send File">
    </form>

    Expected result:
    ----------------
    Netscape gives an error of "The doent contains no data".
    In IE I get the page cannot be displayed error.




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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=26326&edit=1[/url]
    sniper@php.net Guest

Similar Threads

  1. Help! Preview wont work but director file does
    By jim2233 in forum Macromedia Director Basics
    Replies: 3
    Last Post: April 7th, 11:58 AM
  2. #26326 [Bgs]: File upload wont work if spaces not in the right place.
    By pollita@php.net in forum PHP Development
    Replies: 3
    Last Post: December 2nd, 06:45 PM
  3. Replies: 0
    Last Post: November 21st, 12:30 AM
  4. #26326 [Fbk->Opn]: File upload wont work if spaces not in the right place.
    By jnixon at postregister dot com in forum PHP Development
    Replies: 1
    Last Post: November 20th, 03:09 PM
  5. #26326 [NEW]: File upload wont work if spaces not in the right place.
    By jnixon at postregister dot com in forum PHP Development
    Replies: 0
    Last Post: November 19th, 11:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139