Jump to content

Archived

This topic is now archived and is closed to further replies.

jeff42

Need Help with File Checking

Recommended Posts

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!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.