Jump to content


Photo

Need Help with File Checking


  • Please log in to reply
1 reply to this topic

#1 jeff42

jeff42
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 28 September 2006 - 04:22 AM

Hi,

I'm new to php, learning as I go. I'm trying to write a simple file checking function to verify that an uploaded file is a zip file. It works fine for Mac users but not for Windows users. I have no idea why this is happening.

Here's a piece of my code:

if($img_type == "application/zip"){

// COPY FILE TO DIRECTORY
copy($img_data, $path . $new_image_name);

After much frustration, I changed the first line to this:

if("1"){

... and then everything else works as it should. The file gets moved to the right directory, etc.

For some reason it's not recognizing zip files created on Windows machines, at least not with the code I'm using.

Any ideas?

Thanks!

#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 28 September 2006 - 04:53 AM

How do you define $img_type ?

Orio.
Think you're smarty?

(Gone until 20 to November)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users