lexmoen Posted August 22, 2008 Share Posted August 22, 2008 I try to make a possibility to upload photo's from my website to the hostserver. should be easy, but i get a forbidden reaction the page is: <FORM ENCTYPE="multipart/form-data" ACTION="upload" METHOD=POST> Upload: <INPUT NAME="userfile" TYPE="file"> <INPUT TYPE="submit" VALUE="verstuur foto"></FORM> <?php if ($userfile_size >250000){$msg=$msg."the foto is groter dan 250kb. Bezoek de help-pagina om te zien hoe de file verkleind kan worden.<BR>"; $file_upload="false";} if (!($userfile_type =="image/pjpeg" OR $userfile_type=="image/gif")){$msg=$msg."foto's moeten van het formaat jpg of gif zijn.<BR>"; $file_upload="false";} $add="upload/$userfile_name"; // the path with the file name where the file will be stored, upload is the directory name. if(move_uploaded_file ($userfile, $add)){ echo ('uploaden geslaagd.'); } ?> and i get: Forbidden You don't have permission to access /upload/ on this server. I made the map "upload" value 777, so that isn't the answer what am i doing wrong? thnaks lex Link to comment https://forums.phpfreaks.com/topic/120849-cannt-get-access-to-the-server-while-uploading-a-photo/ Share on other sites More sharing options...
BlueSkyIS Posted August 22, 2008 Share Posted August 22, 2008 you probably need the full path for the move: $add=$_SERVER['DOCUMENT_ROOT']."/upload/$userfile_name"; Link to comment https://forums.phpfreaks.com/topic/120849-cannt-get-access-to-the-server-while-uploading-a-photo/#findComment-623029 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.