Solved

move_uploaded_file failing on localhost

Posted on 2010-09-23
3
731 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 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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.

770 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