PDA

View Full Version : upload script help



chris9902
May 26th, 2003, 10:50 AM
ok i got this script

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Title here!</title>
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
Select a file to upload! <input type="file" name="userfile"><br>
<input type="submit" value="Upload!">
</form>
</body>
</html>

and this is the .php file

<?php

if(!(copy($_FILES['userfile']['tmp_name'], "Upload/" . $_FILES['userfile']['name']))) die("Cannot upload files.");

echo "Upload Complete!";

?>


the HTML is called upload.htm and the php file is upload.php
i have a folder that the files go to called Upload
but i get this error



Warning: Unable to create 'Upload/EXAMPLE.gif': Permission denied in /home/vhosts/gta.to-j.com/upload.php on line 3
Cannot upload files.

is this my host blocking it or what :-\

Jubba
May 26th, 2003, 10:56 AM
you have to make sure that you CHMOD the folder that you are uploading the files to...

chris9902
May 26th, 2003, 03:32 PM
ok how do i do that

Jubba
May 26th, 2003, 04:10 PM
chck with your server. its different on different servers... usually you need to use an FTP program..

chris9902
May 26th, 2003, 04:12 PM
yeah i am using smart ftp (becuase it's free:) ) and what do i ask

if my folder Upload/ is CHMOD (whatever that is)

Jubba
May 26th, 2003, 04:15 PM
ask how to CHMOD the value of the folder to 777

chris9902
May 26th, 2003, 04:17 PM
ok i will let you no what they said but it is a **** free service, i use it to pratice on

Jubba
May 26th, 2003, 04:18 PM
ok, if they dont' offer any help, then there is probably a feature in smartFTP that will allow you to CHMOD the folder's permissions, but I have never used it... so I'm not sure..

chris9902
May 26th, 2003, 04:23 PM
ok i found it in Smart FTP but what do i type

right click Upload folder

commands > misc > CHMOD

the this comes up

SITE CHMOD %a[Mode] %a[File Name]
with a box under it saying parameter

Jubba
May 26th, 2003, 04:24 PM
can you take a screen shot?

chris9902
May 26th, 2003, 04:32 PM
sorry about the piss poor shot but it's not a work of art:P

http://www.geocities.com/gta_games/shot.htm

also here the site i got it from if that helps

http://robouk.mchost.com/tuts/tutorial.php?tutorial=fileupload