473,947 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

upload image (win]

Hi,

I can't figure what I've doing wrong with my code :

in my Form :

<form name="form1" method="post" action="do_insc ription.php">
<p align="center"> <img src="images/logo.jpg" width="400" height="80"></p>
<div align="center">
<table width="500" border="0">
..
<td><input name="avatard" type="file" id="avatard"
enctype="multip art/form-data"></td>
<input type="hidden" name="MAX_FILE_ SIZE" value="30000" />
..

in my "action script" :
.....
$file = $HTTP_POST_FILE S['avatard'];

if ($file && $file['size']<=1024000000 && $file['size']>0){
if (copy($file['tmp_name'],"./avatard/".$file['name'])){
echo "Fichier Uploadé";
} else echo "L'upload à échoué.";
}else echo "Fichier trop volumineux ou innexistant";
....

When I execute this script I get this error message : Undefined index: avatard
File to big or inexistant (translated from french(

thx in advance

Jul 17 '05 #1
2 1800
You need to set your form's enctype:
<form name="form1" method="post" action="do_insc ription.php"
enctype="multip art/form-data">

- Kevin

"Alexandre Jaquet" <no@email.com > wrote in message
news:41******** *************** @news.sunrise.c h...
Hi,

I can't figure what I've doing wrong with my code :

in my Form :

<form name="form1" method="post" action="do_insc ription.php">
<p align="center"> <img src="images/logo.jpg" width="400" height="80"></p>
<div align="center">
<table width="500" border="0">
..
<td><input name="avatard" type="file" id="avatard"
enctype="multip art/form-data"></td>
<input type="hidden" name="MAX_FILE_ SIZE" value="30000" />
..

in my "action script" :
....
$file = $HTTP_POST_FILE S['avatard'];

if ($file && $file['size']<=1024000000 && $file['size']>0){
if (copy($file['tmp_name'],"./avatard/".$file['name'])){
echo "Fichier Uploadé";
} else echo "L'upload à échoué.";
}else echo "Fichier trop volumineux ou innexistant";
...

When I execute this script I get this error message : Undefined index:
avatard
File to big or inexistant (translated from french(

thx in advance

Jul 17 '05 #2
Thanks Kevin :0)

"Kevin" <ke***@wxREMOVE 4SPAM3.com> wrote:
You need to set your form's enctype:
<form name="form1" method="post" action="do_insc ription.php"
enctype="multi part/form-data">

- Kevin

"Alexandre Jaquet" <no@email.com > wrote in message
news:41******* *************** *@news.sunrise. ch...
Hi,

I can't figure what I've doing wrong with my code :

in my Form :

<form name="form1" method="post" action="do_insc ription.php">
<p align="center"> <img src="images/logo.jpg" width="400" height="80"></p>
<div align="center">
<table width="500" border="0">
..
<td><input name="avatard" type="file" id="avatard"
enctype="multip art/form-data"></td>
<input type="hidden" name="MAX_FILE_ SIZE" value="30000" />
..

in my "action script" :
....
$file = $HTTP_POST_FILE S['avatard'];

if ($file && $file['size']<=1024000000 && $file['size']>0){
if (copy($file['tmp_name'],"./avatard/".$file['name'])){
echo "Fichier Uploadé";
} else echo "L'upload à échoué.";
}else echo "Fichier trop volumineux ou innexistant";
...

When I execute this script I get this error message : Undefined index:
avatard
File to big or inexistant (translated from french(

thx in advance



Jul 17 '05 #3

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

Similar topics

3
11790
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
15
5394
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the path of the uploaded image, and resize it with the provided dimensions. My function is below. The current function is returning an error when run from the upload function: A generic error occurred in GDI+. Not sure what exactly that means. From what...
0
4764
by: SEMIH DEMIR | last post by:
Sitelerden birinde verilen yabancı kaynakli bir scriptti duzenledim yanlız birseyin içinden bir turlu cıkamadım işin aslı ilk defa persistin upload componentini kullanacam yanlız suanki haliyle verdiği hata şu.Bilen arkadaşlar lütfen yardım edin Persits.Upload.1 error '800a0020' The system cannot find the path specified. /classifieds/upload.asp, line 250
4
5908
by: Jim Michaels | last post by:
after a file upload, $_FILES is not populated but $_POST is. what's going on here? $_POST=C $_POST=C $_POST=C $_POST=C:\\www\\jimm\\images\\bg1.jpg $_FILES= $_FILES= $_FILES=
9
3861
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web site for a small club I belong to and one of the features I would like to include is the ability to allow users to upload image files. unfortunately the servers web root www folder only allows READ and EXECUTE permissions, which makes it...
3
2990
by: samoore | last post by:
Can you upload an image using a windows app. I either want to upload the image to a database or just a folder, but all of my searches show that you have to use a web app. I want to do this with a win app. Any help would be appreciated. Samoore33
3
4521
by: kksandeep | last post by:
i am using this three files to uplod file. i got this file from net but i think these have some error. i am new to this field plz help the script i found is some helpful but not too that i need my objective is this that when i uplod a file it should be desply on same page with ajax uplod after when i refresh page this should be not remains longer and on clicking other image its replase previous image plz help how i can do this the...
1
3969
by: kksandeep | last post by:
i am using this three files to uplod file. i got this file from net but i think these have some error. i am new to this field plz help the script i found is some helpful but not too that i need my objective is this that when i uplod a file it should be desply on same page with ajax uplod after when i refresh page this should be not remains longer and on clicking other image its replase previous image plz help how i can do this the...
7
2378
by: xx75vulcan | last post by:
Hi, I've got a PHP Upload Form that works great, unless that is, the image your uploading has been modified through a photo editing software. Example: if I upload the image straight from a camera or other, it uploads fine. However, If I want to rotate the image, or resize it with photoshop or simmilar, making sure to save it again as a jpg, the PHP upload won't upload the image.
5
3301
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is _uploadedfiles_xxxx) (php must be allowed to move uploaded files to this folder' - uploadedfiles_xxxx. I typed <?php chmod ('_uploadedfiles_xxxx',640); ?> into notepad and saved it as php in the uploaded_xxxx folder, when I went to test it, the error...
0
9982
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11566
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11342
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10689
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7427
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6113
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6331
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4943
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4533
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.