Solved

move_uploaded_file failing on localhost

Posted on 2010-09-23
3
734 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
[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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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.

740 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