14. januar 2002 - 00:12Der er
8 kommentarer og 1 løsning
Jeg kan ikke få dette upload script til at virke?
<? $updir = \"/home/zachwhit/public_html/img\"; //absolute path to where files are uploaded, no trailing slash $sizelim = \"yes\"; //do you want size limitations yes or no $size = \"25000\"; //if you want size limited how many bytes $certtype = \"no\"; //do you want certain type of file, no recommended $type = \"\"; //what type of file would you like
//error if no file is selected if ($file_name == \"\") { die(\"No file selected to upload\"); } //error if file exists if (file_exists(\"$updir/$file_name\")) { die(\"The file you are trying to upload already exists\"); } //error if file is to big if ($sizelim == \"yes\") { if ($file_size > $size) { die(\"The file you are trying to upload is too big.\"); } } //error if file isn\'t certain type if ($certtype == \"yes\") { if ($type != $file_type) { die(\"The file you are trying to upload is wrong type\"); } } @copy($file, \"$updir/$file_name\") or die(\"The file you are trying to upload couldn\'t be copied to the server\"); ?> <html> <head> <title>File Uploaded</title> </head> <body> <p> <h2>File Uploaded</h2> File Name: <? echo \"$file_name\"; ?><br> File Size: <? echo \"$file_size\"; ?><br> File Type: <? echo \"$file_type\"; ?> </p> </body> </html>
Jeg er ikke helt sikke på hvordan den absolutte sti til hvor billederne skal uploades skal skrives?
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
<? $updir = \"/img\"; //absolute path to where files are uploaded, no trailing slash $sizelim = \"yes\"; //do you want size limitations yes or no $size = \"5000000\"; //if you want size limited how many bytes $certtype = \"no\"; //do you want certain type of file, no recommended $type = \"\"; //what type of file would you like
//error if no file is selected if ($file_name == \"\") { die(\"No file selected to upload\"); } //error if file exists if (file_exists(\"$updir/$file_name\")) { die(\"The file you are trying to upload already exists\"); } //error if file is to big if ($sizelim == \"yes\") { if ($file_size > $size) { die(\"The file you are trying to upload is too big.\"); } } //error if file isn\'t certain type if ($certtype == \"yes\") { if ($type != $file_type) { die(\"The file you are trying to upload is wrong type\"); } } copy($file, \"$updir/$file_name\") or die(\"The file you are trying to upload couldn\'t be copied to the server\"); ?> <html> <head> <title>File Uploaded</title> </head> <body> <p> <h2>File Uploaded</h2> File Name: <? echo \"$file_name\"; ?><br> File Size: <? echo \"$file_size\"; ?><br> File Type: <? echo \"$file_type\"; ?> </p> </body> </html>
men når jeg forsøger at uploade siger den det her:
The file you are trying to upload couldn\'t be copied to the server
Da det er et windows server behøver man ikke at chmode... Det er meget underligt for jeg har brugt andre upload scripts på webpunkt som virker, men de samme scripts virker ikke på friserver???
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.