uploading a file [PHP / HTML]

terryurden

New Member
Messages
5
Reaction score
0
Points
0
<form action="upload_file.php" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label><input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>

i use this small upload code a file to my page i like to extract some data from. On my local WAMP server it works without problems... here on x10 i get a 500 internal error (when the file is submitted)....

what can it be?
 
Last edited:

Wizet

New Member
Messages
644
Reaction score
0
Points
0
Well there's a big difference between your wampserver and the humongous servers that X10 are using.
 

cursedpsp

New Member
Messages
237
Reaction score
0
Points
0
Whats with the "<label for>"?

Its not your HTML file, its the PHP file - since HTML isnt a server-sided language

It seems you are following w3schools yes? Remove the <label> since its needless
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
no label isn't useless. if they click the text within label, it'll make the for="" the active text box. in this case, it they click filename:, the input with the name: file will become the active input box. i think it's something with the server changes because i cannot upload images either...

other than the php.ini and the apache httpd.conf files, there's no difference (server sizes dont make a difference for compatibility).
 
Last edited:

terryurden

New Member
Messages
5
Reaction score
0
Points
0
i gladly remove the <label> tags if it would solve my problem... but it doesn't... is there some configuration thing i must set some files are accepted?
 

natsuki

New Member
Messages
112
Reaction score
0
Points
0
this has something to do with the php script or the server, though i think it's really the server. what files are you trying to upload?

it doesn't really matter whether you remove the <label> or not, it won't cause any problems
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
To upload, just drag it in your ftp server and use the link from there.
there's a couple of reasons to not do this. one, on my site, i have an upload form for images that is part of a bigger system, and it does everything automatically. It resizes it, and uploads it to a specific directory, depending on my $_GET variable, and names it according to it's position. It would simply take too much time to do this by hand.

another reason is for member stuff, like attachments or user avatars that are uploaded to the server.
 

terryurden

New Member
Messages
5
Reaction score
0
Points
0
this has something to do with the php script or the server, though i think it's really the server. what files are you trying to upload?

trying to get .xlm files. I got a parser for them so i can put the data in them into a database to track several things.

there's a couple of reasons to not do this. one, on my site, i have an upload form for images that is part of a bigger system, and it does everything automatically. It resizes it, and uploads it to a specific directory, depending on my $_GET variable, and names it according to it's position. It would simply take too much time to do this by hand.

1. did you make any config changes to get the upload working?
2. would it matter to change to post action to a get action?
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
1) no, i did not make any changes to any config files to make it work (it seems to be a server issue as it's now working for me).

2) no. you should stick with post. I merely used $_GET[] to define the name of the game that i was adding it to.

I've got a list of games that have ?game=gamename and i pass that along through a link. from there, i read how many achievements there are for the game, and display that many forms. Each of them have their own unique value name="achievement[$i]", and when I upload them, depending on the name of the game and the value of $i, i upload a file named a{$i}.png to the directory defined by the game name. gears of war 2's directory would be /g/gearsofwar2/.
 

smcc08

New Member
Messages
1
Reaction score
0
Points
0
Whats with the "<label for>"?

Its not your HTML file, its the PHP file - since HTML isnt a server-sided language

It seems you are following w3schools yes? Remove the <label> since its needless
Are you serious? Lrn 2 semantic code plz.
 

quantum1

New Member
Messages
68
Reaction score
0
Points
0
I may have missed it somewhere above, but can you post the source code in your upload_file.php source file?
 
Top