473,226 Members | 1,480 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,226 software developers and data experts.

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_inscription.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="multipart/form-data"></td>
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
..

in my "action script" :
.....
$file = $HTTP_POST_FILES['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 1770
You need to set your form's enctype:
<form name="form1" method="post" action="do_inscription.php"
enctype="multipart/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_inscription.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="multipart/form-data"></td>
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
..

in my "action script" :
....
$file = $HTTP_POST_FILES['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***@wxREMOVE4SPAM3.com> wrote:
You need to set your form's enctype:
<form name="form1" method="post" action="do_inscription.php"
enctype="multipart/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_inscription.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="multipart/form-data"></td>
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
..

in my "action script" :
....
$file = $HTTP_POST_FILES['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
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...
15
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...
0
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...
4
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
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...
3
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...
3
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 ...
1
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 ...
7
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...
5
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...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.