LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-29-2012, 04:38 AM   #1
quotetom
LQ Newbie
 
Registered: May 2012
Posts: 5
Blog Entries: 1

Rep: Reputation: Disabled
ftp_put() [function.ftp-put]: Cannot STOR. No permission


Hi,

Can someone help. I'm trying to upload a file upto a server via ftp.

I have had to connect through ssl connection as the server asks for a certificate.

Can you see where im going wrong?


I have the below code:

$connection = ftp_ssl_connect($server);

$login = ftp_login($connection, $ftp_user_name, $ftp_user_pass);
if (!$connection || !$login) {
die('Connection attempt failed!');
}else{
$upload = ftp_put($connection, $file, $remote_file, FTP_BINARY);
}

if (!$upload) { echo 'FTP upload failed!'; }



error message : Warning: ftp_put() [function.ftp-put]: Cannot STOR. No permission
 
Old 05-29-2012, 04:49 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
probably you tried to write a read-only directory.
 
Old 05-29-2012, 05:18 AM   #3
quotetom
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
The folder I'm writing the files too are set to writeable.

Could it be something to do with the ssl connection?
 
Old 05-30-2012, 02:24 AM   #4
quotetom
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Hi,

Found the solution. This may help someone:

This needed to placed after login section for it to work.

ftp_pasv($connection, true);
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ftp not returning from STOR <file> keefobeefo Linux - Networking 2 06-04-2009 02:36 AM
ftp commands (STOR) infonlinebr Linux - Newbie 1 07-09-2008 07:01 PM
FTP Server: STOR /somefile: 550 Access is denied robbbert Linux - Server 5 05-11-2007 04:10 AM
C question;how do I put struct in function? ngan_yine Programming 10 02-09-2005 02:54 PM
Hang on LIST or STOR in FTP Torm3nt Linux - Networking 8 01-29-2004 12:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration