Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File upload works from OSX, not from WIndows...

Status
Not open for further replies.

admoore

IS-IT--Management
May 17, 2002
224
0
0
US
Never experienced anything quite like this...

File handling within PHP script running on BSD server accepts uploaded files from OSX (Mac) computers with seeming any browser; but not from any windows machine regardless of browser...

Code:
if(isset($upload)) {  // process uploaded file
$allowedExts = array("txt", "csv");
$extension = end(explode(".", $_FILES["file"]["name"]));
if ((($_FILES["file"]["type"] == "text/csv"))
&& ($_FILES["file"]["size"] < 4000000)
&& in_array($extension, $allowedExts))	

// write temp file
      move_uploaded_file($_FILES["file"]["tmp_name"],
      "upload/" . $_FILES["file"]["name"]);
      $debug .= "<p>Stored in: " . "/upload/" . $_FILES["file"]["name"]."</p>";

if ($_FILES["file"]["error"] > 0)
  { $debug .="<p>Error: " . $_FILES["file"]["error"] . "</p>"; }

Any ideas ???
 
Solved it...

Files from Windows detected as $_FILES["file"]["type"] == "text/plain" Not "text/csv"

-A
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top