Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2016-07-19
2
Medium Priority
?
101 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

650 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