[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Webmasterplein.net • Toon onderwerp - PHP fout bij het uploaden van een foto via een script :(
aan alle goede dingen komt een eind, webmasterplein.net 2003 - 2013
wij danken jullie voor al mooie momenten die dankzij dit forum ontstonden - Derk, Rutger en Stef

PHP fout bij het uploaden van een foto via een script :(

Je komt er niet helemaal uit bij het scripten? Übergoede functie geschreven? Alles met betrekking tot scripting, kun je hier terecht.

PHP fout bij het uploaden van een foto via een script :(

Berichtdoor bmxonline » 15 apr 2005 17:13

Hallo,

Ik heb een script waarmee ik fotos kan uploaden...
Maar als ik de foto wil uploaden krijg ik de volgende foutmelding:

Warning: move_uploaded_file(/usr/export/www/hosting/rateapicture/fotoalbum/photos/Cartoons/aapk.jpg): failed to open stream: No such file or directory in /usr/export/www/hosting/rateapicture/admin/fotoupload.php on line 22

Warning: move_uploaded_file(): Unable to move '/usr/export/tmp/phpWQiqdX' to '/usr/export/www/hosting/rateapicture/fotoalbum/photos/Cartoons/aapk.jpg' in /usr/export/www/hosting/rateapicture/admin/fotoupload.php on line 22

Dit is mijn code van fotoupload.php:

[syntax="php"]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Upload foto!</title></head>
<body bgcolor="#D5D5D5">
<?
include '../config.php';

$photo = $_GET['pic'];
$folder = $_GET['folder'];

if($_POST['submit']){
if (is_uploaded_file($_FILES['uploadfoto']['tmp_name'])){
$filename = $_FILES['uploadfoto']['name'];
$extensie = substr($filename, -3);
if (strtoupper($extensie) != "JPG" && strtoupper($extensie) != "GIF" && strtoupper($extensie) != "BMP" && strtoupper($extensie) != "ZIP") {
echo "<BR><font size='2' face='Verdana'>Je kan alleen gif, jpg, bmp en zip-bestanden uploaden!";
}
else {
$store_pad = $_SERVER['DOCUMENT_ROOT']."/fotoalbum/photos/".$_GET['folder'];
$file = $_FILES['uploadfoto']['name'];
move_uploaded_file($_FILES['uploadfoto']['tmp_name'], "$store_pad/$file") or die("fout");
if (strtoupper($extensie) == "ZIP"){
$path = $_SERVER['DOCUMENT_ROOT']."/fotoalbum/photos/".$_GET['folder']."/";
$filee = $store_pad."/".$file;
$zip = zip_open($filee);
if ($zip) {
while ($zip_entry = zip_read($zip)) {
if (zip_entry_filesize($zip_entry) > 0) {

$complete_path = $path.dirname(zip_entry_name($zip_entry));
$complete_name = $path.str_replace("%20","_",zip_entry_name($zip_entry));

if (zip_entry_open($zip, $zip_entry, "r")) {
$fd = fopen($complete_name, 'w');
fwrite($fd, zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)));
fclose($fd);
zip_entry_close($zip_entry);
}
}
}
zip_close($zip);
}
}
unlink($filee);
echo "<BR><font size='2' face='Verdana'>Het bestand is geupload!</font><BR><BR><INPUT type=submit value='Sluit venster!' onClick=\"window.opener.location='$url/admin/index.php?folder=$folder&photo=$file'; window.close();\">";
}
}
}
else if($_GET['aktie'] == "delete"){
echo "<BR><font size='2' face='Verdana'>Weet je zeker dat je onderstaande foto wilt verwijderen?</font><BR><INPUT type=submit value='Ja' onClick=\"window.location='$url/admin/fotoupload.php?aktie=deletefinal&folder=$folder&pic=$photo';\"><INPUT type=submit value='Nee' onClick=\"window.opener.location='$url/index.php?folder=$folder&photo='; window.close();\">";
if ($folder != "") {
$photoo = "../photos/$folder/$photo";
}

else {
$photoo = "../photos/$photo";
}

$image_size = getimagesize($photoo);
$image_width = $image_size[0];
$image_height = $image_size[1];

if ($image_width > 350) {
$value = $image_width / 350;

$display_width = 350;
$display_height = round ($image_height / $value);
}
else {
$display_width = $image_width;
$display_height = $image_height;
}
echo "<BR><BR><center><img src='$photoo' width='$display_width' heigth='$display_height'></center>";
}
else if($_GET['aktie'] == "deletefinal"){
mysql_query("DELETE FROM foto_reacties WHERE picname = '$photo'");
mysql_query("DELETE FROM foto_info WHERE picname = '$photo'");
unlink("../photos/$folder/$photo");
echo "<BR><font size='2' face='Verdana'>De foto is verwijderd!</font><BR><BR><INPUT type=submit value='Sluit venster!' onClick=\"window.opener.location='$url/admin/index.php?folder=$folder&photo='; window.close();\">";
}
else {
?>
<form name='wijzig' method='post' action='fotoupload.php?folder=<? echo $folder; ?>' enctype='multipart/form-data'>
<input type='file' name='uploadfoto'>
<input type='submit' name='submit' value='submit'>
</form>
<?
}
?>
</body>
</html>[/syntax]
bmxonline
 

Berichtdoor Derk » 15 apr 2005 18:27

volgens mij staat je server dan niet toe dat je op die manier files upload....
je kan een ander upload systeem proberen van bijvoorbeeld phphulp
Afbeelding
Avatar gebruiker
Derk
Beheerder
Beheerder
 
Berichten: 12634
Geregistreerd: 27 nov 2003 19:50
Woonplaats: Houten

Berichtdoor DarkLoki » 15 apr 2005 21:13

DarkLoki
wmpr
 
Berichten: 176
Geregistreerd: 07 apr 2005 09:57

Berichtdoor bmxonline » 15 apr 2005 21:39

bmxonline
 

Berichtdoor DarkLoki » 16 apr 2005 09:20

DarkLoki
wmpr
 
Berichten: 176
Geregistreerd: 07 apr 2005 09:57

Berichtdoor Derk » 16 apr 2005 11:27

Wat doet het:
htpload het plaatje naar een temp map en dan kopier je hem naar een gewone map.
Kan het zijn dat PHP geen toegang heft tot de temp map?
als ik de error zo lees.....

PS als wij er niet uitkomen weten ze het op PHPhulp waarschijnlijk wel
Afbeelding
Avatar gebruiker
Derk
Beheerder
Beheerder
 
Berichten: 12634
Geregistreerd: 27 nov 2003 19:50
Woonplaats: Houten

Berichtdoor bmxonline » 16 apr 2005 12:21

bmxonline
 

Berichtdoor Derk » 17 apr 2005 10:00

Afbeelding
Avatar gebruiker
Derk
Beheerder
Beheerder
 
Berichten: 12634
Geregistreerd: 27 nov 2003 19:50
Woonplaats: Houten

Berichtdoor Anonymous » 17 apr 2005 14:51

<?
//configuratie voor de database
$db_host = "localhost";
$db_name = "rateapicture";
$db_user = "hier staat normaal mijn naam";
$db_psw = "hier staat normaal mijn wachtwoord";

$smilies = "true"; //verander in 'false' als je geen smilies wilt gebruiken
$ubb = "true"; //verander in 'false' als je geen ubb-codes wilt gebruiken
$plaatjes = "images/smilies/imgfotoalbum"; //pad naar de smilies, zonder / aan het eind
$url = "http://rateapicture.ra.funpic.org/"; //url naar de map waar het script instaat
$webmastermail = "bmxonline@hotmail.com"; //emailadres van de webmaster
$webmasternaam = "Vincent de Vreede"; //naam van de webmaster

//connectie met DB maken
mysql_connect($db_host,$db_user,$db_psw);
mysql_select_db ($db_name);
?>
Anonymous
 

Berichtdoor bmxonline » 17 apr 2005 17:10

bmxonline
 

Berichtdoor Derk » 17 apr 2005 17:25

Afbeelding
Avatar gebruiker
Derk
Beheerder
Beheerder
 
Berichten: 12634
Geregistreerd: 27 nov 2003 19:50
Woonplaats: Houten

Berichtdoor bmxonline » 17 apr 2005 17:59

bmxonline
 


Keer terug naar PHP, ASP, SQL



cron