(lain) wrote in message news:<. com>...
> John Mason Jr <> wrote in message news:<>...
> > lain wrote:
> > > Hi all,
> > >
> > > I have big trouble on Net::FTP, could you please give me some idea??
> > >
> > > My ftp server is on Win2K Prof, IIS.
> > >
> > > First, I tried ftp on my linux server , it works fine.
> > >
> > > Then I created a cgi script, run the script manually on linux server,
> > > to get the file from that Win2K and put on my linux server, it works
> > > fine too.
> > >
> > > However, while i was on my php web system, submit the php POST to the
> > > cgi-script, it show me the internal error.
> > > I go to error log, it shows me the error:
> > > cant open the file, permission denied.
> > >
> > > I really do not know what's wrong, is it my ftp problem? coding
> > > problem or network prob??
> > >
> > > 1. i have set the full permission on ftp folder in win2k.
> > > 2. chmod 777 on my cgi-script
> > > 3. the ftp folder located in C://inetpub/ftproot/test (created as
> > > virtual directory)
> > >
> > > any suggestions, comments, helps are all welcomed.
> > > I'm going to try an alternative to do the task.
> > >
> > > Thanks a lot!!
> >
> >
> > Make sure your directory listing style is Unix not MS-DOS on the IIS FTP
> > server
> >
> >
> > John
>
>
> Hi John,
>
> That's correct, the directory listing was MS-DOS on my FTP server.
> Then I changed to Unix, but it doesnt work...still the same error
> message : permission denied T_T
> Do you have ny other idea??
Hi all,
I'd solved the problem already!!
I would like to answer here in case somebody else need the reference
in future, as me, I searched many similar topic but without the proper
answer!!
Maybe there got something else can solve it out, but this is my
solution :
First, the reason I got the 'permission denied' while i run my cgi
script on the browser is because I act as end user, not the root as
well.
Read from the Net/FTP.pm, when you get the file, it would store the
file in the current directory,in case if you haven't specified the
location. Therefore it would store in the cgi-bin folder, and do you
think it is possible??

(MUST read the module file properly, while i
havent read detail b4

)
So I'd made this :
1. create a folder in public_html, lets say 'temp' (havent tried out
if can store the file besides public_html, but i think possibly can)
2. chmod 777 temp ( i m not that sure if 755 is enough)
my code:
$ftp->get("file1.txt", "/home/server/public_html/temp/file1.txt");
before i was trying to locate it as "../public_html/temp", but it is
really bad idea!
simple right??
Anyway, i do believe there got better solution out there. If you do
have any comments and anything else, please share with me