?
Solved

PHP move_uploaded_file fails for ZIP files but not for JPG or PDF

Posted on 2016-07-19
2
Medium Priority
?
92 Views
Last Modified: 2016-07-19
I have a file upload page which uses AJAX to upload three versions of a print document and process them into an image library. The files are uploaded one at a time in the order PDF, JPG, ZIP. The PDF and JPG files are being accepted and moved into the folder for processing but the ZIP file fails after completing the upload. All three files have exactly the same name except for the extension. The error log is listing two errors, a "no such file or directory" error and an "unable to move file" error.

Is there reason that it would reject ZIPs but not PDFs and JPGs? PHP version is 5.3.3.
0
Comment
Question by:Kim Walker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 41719629
Don't know of anything that might cause this.  Are they all being moved to the same directory?
0
 
LVL 22

Author Closing Comment

by:Kim Walker
ID: 41719658
@Ray, Bull's Eye!

I thought they were. I wrote the code several months ago and didn't remember or notice that zip files were being moved directly to the post-processed folder. In this case, a new category was being created and the folder which would accept the post-processed JPG and PDF hadn't been created yet. I've added a line in the script to create the folder if it doesn't already exist.

I had already figured it out and was testing the fix when I received the notice that you had commented. But you get the golden egg anyway.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question