Solved

move_uploaded_file failing on localhost

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

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now