Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

move_uploaded_file failing on localhost

Posted on 2010-09-23
3
Medium Priority
?
793 Views
Last Modified: 2012-05-10
Was wondering if there were issues using move_uploaded_file on localhost.

In my testing, it always seems to fail.

Also, the tmp_name for the $_FILES array is empty. Why would that be?
0
Comment
Question by:EddieShipman
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
ziceva earned 2000 total points
ID: 33743918
You should post the value of $_FILES['usr_name']['error']

Details here: http://php.net/manual/en/features.file-upload.errors.php

Could be you are missing a /tmp dir or the file is bigger than upload_max_filesize ... that value will clarify things ...
0
 
LVL 26

Author Comment

by:EddieShipman
ID: 33746915
[quote]You should post the value of $_FILES['usr_name']['error'][/quote]
We pass the $_FILES to a function as a parameter called $files. If I print_r($files), error = 1

[quote]
Could be you are missing a /tmp dir or the file is bigger than upload_max_filesize ... that value will clarify things ...[/quote]
upload_tmp_dir = "c:/wamp/tmp"
upload_max_filesize = 2M

File is 3.62 MB so I will modify and test again.
0
 
LVL 26

Author Closing Comment

by:EddieShipman
ID: 33746922
I already tested my mods online and they work. I will test localhost again later.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
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

885 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