473,394 Members | 2,063 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,394 software developers and data experts.

Trouble uploading image

Hi,

I'm using PHP 4 and trying to upload an image. I think I'm using the
right "enctype". Here is the form I submit

<form name=addPhotoForm enctype="multipart/form-data" method=post
action="add_photo_response.php">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td colspan="2" align="center" class="subHeaderClass">Add
Photo</td></tr>
<tr>
<td align="right">Title:&nbsp;</td>
<td align="left"><input type="text" maxlength="255" name="TitleP"
id="TitleP" value=""></td>
</tr>
<tr>
<td align="right">Photo:&nbsp;</td>
<td align="left"><input type="file" name="PhotoImgP"
id="PhotoImgP"></td>
</tr>
<tr><td colspan="2" align="center"><input type="submit"
value="Submit"></td></tr>
</table>
</form>

But in my response page, I get these warnings when I try and check the
value of $_FILES['PhotoImgP'] ...

print "photo param: " . $_REQUEST['PhotoImgP'] . "file: " .
$_FILES['PhotoImgP'] . " " . $_FILES['PhotoImgP']['tmp_name'];

produces

Notice: Undefined index: PhotoImgP in
/usr/local/apache/htdocs/collegedropout/admin/photos/add_photo_response.php
on line 10

Notice: Undefined index: PhotoImgP in
/usr/local/apache/htdocs/collegedropout/admin/photos/add_photo_response.php
on line 10
photo param: shirt.jpgfile: param name: PhotoImgP dest dir:
/usr/local/apache/htdocs/collegedropout/images/photos src_file_path :
Can someone help? Thanks, - Dave

Mar 25 '06 #1
2 1398

Can someone help? Thanks, - Dave

Is your server configured to accept file uploads?

Read this: http://www.php.net/manual/en/features.file-upload.php

--
Carl Vondrick
www.carlsoft.net
usenet [at] carlsoft [dot] net
Mar 25 '06 #2
> photo param: shirt.jpgfile: param name: PhotoImgP dest dir:
/usr/local/apache/htdocs/collegedropout/images/photos src_file_path :

Just a query, where did you assign the upload directory and other
variables?
--
Raqueeb Hassan
Bangladesh

Mar 26 '06 #3

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

Similar topics

5
by: ok | last post by:
Hello, Q: How do I get image width and height before uploading an image? This because, I want to restrict people uploading huge files. Thanks in advance
7
by: lion | last post by:
I get these errors when uploading images via a web page: (the page still uploads the images but reports these errors?) Warning: fopen(D:\php\uploadtemp\php1FC7.tmp) : failed to create stream: No...
4
by: laredotornado | last post by:
Hi, I'm using PHP 4 and I am submitting some images in a form with <form name=addProductForm enctype="multipart/form-data" method=post action="add_product_response.php"> <input type=file...
11
by: bissatch | last post by:
Hi, I am trying to upload an image, create a new file based on that image and then store the base64 encoded image data in a database. I dont really know where my code is going wrong so I will...
10
by: John Smith | last post by:
I know that uploading an image to a database has been covered, oh, about 3 trillion times. However, I haven't found anything covering uploading to a MySQL database with .net. Please don't...
0
by: Alex | last post by:
my app was working fine in VB.NET 2003 (and framework 1.1). Now with VB.NET 2005 (framework 2.0) the uploading to an http server (ie. www.sharebigfile.com) stops with the error "The request was...
44
by: badvoc | last post by:
Hi to all, Firstly I must state my knowledge of php is limited but I am a quick learner. I have taken on the task of finishing a friends website due to his untimely passing and have hit a problem...
1
by: thulaseeram | last post by:
I am using iframe to store uploaded images, it is uploading fine in IE but it is not happening in firefox means first time it is uploading image if i try to upload second image it is not calling even...
1
pezholio
by: pezholio | last post by:
Hi, It seems that every time I put together a new script to upload a file I always have problems, here's the latest one: I've got a form with two file input fields, when I submit the form,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.