473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

File uploads not working

I am trying a simple file upload, but cannot make it work on my
localhost. I wrote the following code:
$strFileDir = "/images/gallery/";
$strFileName = $strFileDir . $_FILES['fImage']['name'];
if (move_uploaded_file($_FILES['fImage']['tmp_name'],$strFileName));
{
echo ("Success");
}

....but get the following errors when uploading "gallery_1.gif":

Warning: move_uploaded_file(/images/gallery/gallery_1.gif): failed to
open stream: No such file or directory in
C:\Development\ChasityChase.com\www\admin\image\im age.php on line 16

Warning: move_uploaded_file(): Unable to move
'C:\PHP\uploadtemp\phpE4.tmp' to '/images/gallery/gallery_1.gif' in
C:\Development\[sitename]\www\admin\image\image.php on line 16
/images/gallery/gallery_1.gif

I am working in Windows XP Pro/IIS, in case you couldn't tell.

Thanks in advance,
james
Jul 17 '05 #1
1 1523
Hi James

You will need to give the full path of where you want the file moved to.

$strFileDir = "/images/gallery/"; won't work

$strFileDir = "c:/path/to/files/images/gallery/"; should work

--
Paul Barfoot
"James Arnall" <ne**@jamesarnall.com> wrote in message
news:Vv********************@comcast.com...
I am trying a simple file upload, but cannot make it work on my localhost.
I wrote the following code:
$strFileDir = "/images/gallery/"; $strFileName = $strFileDir .
$_FILES['fImage']['name'];
if (move_uploaded_file($_FILES['fImage']['tmp_name'],$strFileName));
{
echo ("Success");
}

...but get the following errors when uploading "gallery_1.gif":

Warning: move_uploaded_file(/images/gallery/gallery_1.gif): failed to open
stream: No such file or directory in
C:\Development\ChasityChase.com\www\admin\image\im age.php on line 16

Warning: move_uploaded_file(): Unable to move
'C:\PHP\uploadtemp\phpE4.tmp' to '/images/gallery/gallery_1.gif' in
C:\Development\[sitename]\www\admin\image\image.php on line 16
/images/gallery/gallery_1.gif

I am working in Windows XP Pro/IIS, in case you couldn't tell.

Thanks in advance,
james

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Matt | last post by:
I want to write a ASP page to open/download a file In fileview.jsp, I have the file browse, and when user click submit button, fileview2.asp should open the file. fileview.asp ============...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
12
by: JMB | last post by:
Hello, I was wondering if anyone knew of any projects extending the inline upload progress bar to utilize an inpage image uploader with bar, without having to refresh or go to a seperate page,...
3
by: lawrence k | last post by:
I once had this page working, but now it is not working. It allowed multiple file uploads. Now it does not. The problem seems to happen instantly, which makes me think I've a problem with the form,...
4
by: yehaimanish | last post by:
I am developing the project management system. Each Project: 1. Title, description ... , stored in mysql database 2. Upto ten files (initial description), (name in db, file in file system) 3....
8
by: mpar612 | last post by:
Hello, I am a newbie to PHP, MySQL. I am trying to create a basic file upload form. I want to get that working and then I want to integrate that into a form that will rename the file and save...
3
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be...
1
by: Robert Strickland | last post by:
Our application uploads a file to go through some parsing. Towards the end of the process, the application moves the file from the 'processing' folder to an archive location. However, at times this...
1
by: recordlovelife | last post by:
Hi all. I need to make a file uploader, so a client can upload pictures to a directory on their shared server, so that they can later include the photos in news updates. I simply want to take...
2
by: manirajmurali | last post by:
hi all, i have face this problem more 3 days.. if anybody help me.. i have upload file through php coding .. i have download that same file from server.. its coming empty file.. i dont know...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.