Jump to content


Photo

Settting FTP write permission.


  • Please log in to reply
7 replies to this topic

#1 ScottRiley

ScottRiley
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 10 August 2006 - 09:08 AM

Hi, I need to create an upload image system, my code works, and I've managed to allow someone to upload to my FTP server, but in the main directory.  This came about because of an error, where I wanted the file to upload to the '(root)/adverts/images' directory of the ftp.  However, I missed out a backslash, and the uploaded file was saved as 'adverts\imagesfilename.jpg' in the root folder.  I ammended the missing backslash, but now I'm getting a

Warning: move_uploaded_file(I REMOVED THE DIRECTORY, BUT YOU GET IT, RIGHT?/Winter.jpg): failed to open stream: FTP server reports 530 Login incorrect. in /REMOVED DIRECTORY/fileupload.php on line 4


Now, I believe I need to set write permissions for this folder, but how do I do so, I have unchecked the 'Read-Only' attribute, but, as I assumed, that didn't do a thing, how would I go about allowing write permission to this folder?

thanks in advance.

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 10 August 2006 - 10:51 AM

FTP server reports 530 Login incorrect

That looks like you problem.. either it's loggign in anonymous or your username and password for FTP are incorrect.

Think you would get an access denied if it were a problem with writepermissions to the directory.

Regards
Liam
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 ScottRiley

ScottRiley
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 10 August 2006 - 10:53 AM

Well, I'm logged into my FTP, and it let me upload into the root folder, but it says access denied when it comes to storing it in '/adverts/images/'.  I didn't make any chanes to teh FTP, just the location in the PHP file, should I change the security issues/something of the adverts/images/ file?

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 10 August 2006 - 10:55 AM

post your code your folder order looks wrong.


show the url your using ok
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 ScottRiley

ScottRiley
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 10 August 2006 - 10:59 AM

<?php
		$destination='ftp://domain.co.uk@ftp.domain.co.uk/web/southport/adverts/images/';
	$destination=$destination.basename($_FILES['imagefile']['name']);
	if(move_uploaded_file($_FILES['imagefile']['tmp_name'], $destination))
	{
		print("upload succesful");
	}
		else
	{
		print("Upload failed");
	}
?>

This will obviously be extended to include file validation atc.

#6 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 10 August 2006 - 11:08 AM

Your not carrying a password in the destrination..

also if it's a linux server you could ssh in and 'ls-ls' the directory to see who the owner is set as..

EDIT:

$destination='ftp://domain.co.uk@ftp.domain.co.uk/web/southport/adverts/images/';

should be

$destination='ftp://username:password@ftp.domain.co.uk/web/southport/adverts/images/';


Liam
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#7 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 10 August 2006 - 11:14 AM

i recon it's windows

you got to add the username and password
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#8 ScottRiley

ScottRiley
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 10 August 2006 - 11:18 AM

So, could I just use my user and passwod for the FTP site, and it'll upload fine, even if someone is uploading from a different computer?  You'll have to bear with me here, I've only been learning a week or so.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users