php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16353 can upload other files but not zip or visio files
Submitted: 2002-03-29 16:28 UTC Modified: 2002-07-29 01:00 UTC
Votes:8
Avg. Score:3.8 ± 0.8
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:1 (16.7%)
From: cindy_walker at dot dot ca dot gov Assigned:
Status: No Feedback Package: HTTP related
PHP Version: 4.2.0 OS: Irix 6.5
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-03-29 16:28 UTC] cindy_walker at dot dot ca dot gov
I have file uploads working with images, Word and Excel files and text files, but when I try  to upload zip or visio files I see this message: "Unable to open 'none' for reading. No such file or directory..." It captures the name and mime type (application/x-zip-compressed and application/octet-stream, resp.) but $attachment is set to 'none' and $attachment_size is 0.  

Here's the relevant part of the form:

<form method="post" name="form" action="uploadtest.php" enctype="multipart/form-data">

<input type="hidden"  name="MAX_FILE_SIZE" value="100000">

<input type="file" name="attachment">

Here's the relevant part of the script that handles it:

$strLength1 = strlen($attachment_name);

 if ($strLength1 > 0) {

  $suffix1 = substr($attachment_name,($strLength1 - 4),4);

  $upfile1 = "/www/pub/changecontrol/files/".$latestRecord."-1".$suffix1;  //$latestRecord is defined earlier
  if (!copy($attachment,$upfile1)) {

    echo "Problem: Could not move file into directory.";

    exit;

  }

}

Any workaround for this?
We're using Apache 1.3.18.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-02 13:40 UTC] sander@php.net
I think it's a problem with your browser, not with PHP. Anyway, can you try the latest RC from www.php.net/~derick ?
 [2002-04-04 16:01 UTC] cindy_walker at dot dot ca dot gov
You're right about it being browser related.  Uploading zip and visio files works with IE 6, but not with Netscape 6.2 or 4.7x and not with IE 5.0.  I haven't tested IE 5.5.  Our admin will compile and install the latest RC in the next few days.  I'll report back on how that affected uploads of our problem files.
 [2002-04-13 19:14 UTC] shiflett@php.net
If this problem persists, it would be very helpful if you could capture (or have someone else capture) the underlying HTTP traffic this transaction produces.

Feel free to email me personally if you would like help in this regard.
 [2002-06-18 04:19 UTC] hholzgra@php.net
any news here?
 [2002-06-18 12:10 UTC] cindy_walker at dot dot ca dot gov
Finally we have PHP 4.20 installed.  It does solve the problem for uploading zip files with Netscape 4.7.  It still doesn't allow the successful upload of visio files. It puts the file on the server with the correct name, but its a zero KB file.

These PHP commands: 

echo "HTTP_POST_FILES tmpname: ".$HTTP_POST_FILES['attachment'] ['tmp_name']."<br>\n";
echo "attachment_name: ".$attachment_name."<br>\n";
echo "attachment: ".$attachment."<br>\n";
echo "attachment_size: ".$attachment_size."<br>\n";
echo "attachment_type: ".$attachment_type."<br>\n";

result in this output: 

HTTP_POST_FILES tmpname: 
attachment_name: test.vsd
attachment: 
attachment_size: 0
attachment_type: 

PHP 4.2 can get the name but little else from a visio file. 

I'll see if I can get one of the server admins to look at the http traffic that happens during the upload of visio files.
 [2002-06-18 12:32 UTC] sander@php.net
I really think this is a browser issue. What happens if you rename a viso file to .jpg or .gif, or any other extension that does work? If you can upload that file, then it's a browser problem.
 [2002-06-18 12:57 UTC] cindy_walker at dot dot ca dot gov
I get the identical response after I renamed the file to have the extension .jpg.  Using IE 6.0, Netscape 6.2 or Opera 6.2 doesn't work either for visio files. It looks like visio is the only problem file type. 

This isn't a big problem for us.  I was asked to add a file upload feature to an application, but so far no one has uploaded any files.
 [2002-06-18 16:13 UTC] sniper@php.net
Let me guess: the visio file you're uploading is big?
And your php.ini settings for upload_max_filesize and post_max_size are smaller and that's why the file is never
gonna get there..

Try this very simple example:


<form method="post" name="form" action="uploadtest.php" enctype="multipart/form-data">
<input type="file" name="attachment">
<input type="submit">
</form>
<?php print_r($_FILES); ?>

And try submitting one of those problematic files and
paste the output here.


 [2002-07-29 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2003-03-03 18:29 UTC] comelon33 at hotmail dot com
first ,my Englist is poor,
I find if I change the files's subfilename to *.doc or *.txt at computer,then I can upload the files.
but if I change the subfilename at php' code , It still failed...
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 21:01:56 2014 UTC