Please verify you are human

PHP fileupload
  Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 01:52

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



PHP fileupload

Discussion on PHP fileupload within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
epiTR's Avatar
 
elite*gold: 185
Join Date: May 2008
Posts: 3,646
Received Thanks: 603
PHP fileupload

Huhu,
ich habe gerade ein Problem mit dem Upload von Dateien mit PHP.
Ich bekomme es nicht hin, irgendetwas von der Datei zu bekommen (tmp_name, name, etc.).
Habt ihr da vielleicht eine Idee?

upload.html
PHP Code:
<form action="upload.php" method="post">
    <
input type="text" name="title" id="title" value="Title" onfocus="if(this.value == \'Title\') { this.value = \'\'; }"><br>
    <
textarea name="description" id="description" cols="40" rows="10" onfocus="if(this.value == \'Description\') { this.value = \'\'; }">Description</textarea><br>
    <
input type="file" name="upload" id="upload" value="File"><br>
    <
input type="submit" id="submit" value="Submit">
</
form
upload.php
PHP Code:
<?php
if (isset($_POST['title']) && isset($_POST['description']) && isset($_FILES['upload']['tmp_name'])) {
    
$tile $_POST['title'];
    
$description $_POST['description'];
    
$file $_FILES['file'];
    echo 
"Alle Daten empfangen";
} else {
    echo 
"Fehlerhafte Daten";
}
// if
?>
epiTR is offline  
Old 04/04/2012, 14:04   #2
 
Deathman10's Avatar
 
elite*gold: 92
Join Date: Oct 2010
Posts: 1,097
Received Thanks: 99
Der Code für das hochladen in einen anderen ordner:
PHP Code:
move_uploaded_file($_FILES['datei']['tmp_name'], "deinuploadordner/".$_FILES['datei']['name']); 
So müsste es klappen, probiers mal aus
Deathman10 is offline  
Old 04/04/2012, 14:32   #3
 
epiTR's Avatar
 
elite*gold: 185
Join Date: May 2008
Posts: 3,646
Received Thanks: 603
Das Problem ist aber, dass das Script nicht einmal "$_FILES['upload']['tmp_name']" kennt.
epiTR is offline  
Old 04/04/2012, 14:36   #4
 
Deathman10's Avatar
 
elite*gold: 92
Join Date: Oct 2010
Posts: 1,097
Received Thanks: 99
Mach in den <form>-Tag noch
PHP Code:
enctype="multipart/form-data" 
rein
Deathman10 is offline  
Thanks
1 User
Old 04/04/2012, 14:46   #5
 
epiTR's Avatar
 
elite*gold: 185
Join Date: May 2008
Posts: 3,646
Received Thanks: 603
Danke, das war der Fehler
epiTR is offline  
Old 04/04/2012, 14:49   #6
 
Deathman10's Avatar
 
elite*gold: 92
Join Date: Oct 2010
Posts: 1,097
Received Thanks: 99
Ahh ok no problem
Deathman10 is offline  
Reply


Similar Threads Similar Threads
[Suche fertiges Fileupload Script]
11/14/2010 - Off Topic - 2 Replies
wie schon oben geschrieben suche ich ein fertiges Fileupload Script für php LG Chris (:
[PHP] Problem mit einem Fileupload Script
04/15/2010 - Web Development - 3 Replies
Hallo Community Ich kämpfe hier grad etwas mit einem PHP Fileupload Script rum. ^^ Hab von PHP nicht so viel Ahnung. Also das Script überprüft nach dem abschicken der Datei das Format (zb .txt) und schickt das an die upload.php: <form ENCTYPE="multipart/form-data" method="post" name="form1" action="uploadgerman.php"> <INPUT NAME="attached" TYPE="file" size="50"><br>



All times are GMT +1. The time now is 01:53.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.