Solved

move_uploaded_file failing on localhost

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

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

626 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