LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 06-25-2002, 08:05 AM   #1
raven
Member
 
Registered: Dec 2001
Location: Basel, Switzerland
Distribution: ubuntu
Posts: 297

Rep: Reputation: 31
ftp upload in php


hello

i wrote this script:

blabla...
echo"
<form enctype=multipart/form-data action=ftp_upload.php method=post>
<input type=file name=users_file>
<input type=hidden name=stream value=".$ftp_stream.">
<input type=submit value=\"Upload File\">
</form>";
...

the ftp_upload.php contains this:

...
if(!ftp_put($stream,$users_file,$users_file,FTP_BINARY))
{
echo "upload failed";
}
...

the problem is, that I get an erro message which says:

Warning: Unable to find ftpbuf 1 in e:\http_server\inv\test\ftp_upload.php on line ...

but why cant I access the ftp stream??? I am sure, the stream was opened correctly because I could read from the stream. (Printed a directory listing). Are ftp streams closed after beig read once?

pls help me!

thanks

raven
 
Old 07-07-2002, 04:56 PM   #2
kervin
Member
 
Registered: Jan 2002
Location: Melbourne, FL.
Distribution: redhat
Posts: 168

Rep: Reputation: 30
this is just a guess, I've used ftp in PHP but I've never tried to share the stream, but...

It looks like you're trying to pass a file descriptor ($ftp_stream or whatever) between to connections, ie. to processes.

every new connection has to reopen the ftp stream, I believe, as that file descriptor for the stream in the last connection is no longer valid.

If you want to connection pool ftp streams, you would need an application server I'm guessing. eg. JSP application server like Apache tomcat http://jakarta.apache.org/ . An application server lets you easily keep variables in "application scope", so that multiple instances ( connection ) can access pooled resources.
 
Old 07-07-2002, 05:33 PM   #3
pickledbeans
Member
 
Registered: Jun 2002
Location: Bailey, CO
Distribution: Slackware
Posts: 483

Rep: Reputation: 31
You might also want to cross post to the php-general news-group :

http://www.php.net/mailing-lists.php
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 upload hinetvenkat Linux - Software 3 06-02-2005 09:34 PM
php - ftp upload thru form j-ray Programming 0 01-04-2005 06:37 AM
Cant upload to another FTP brandog Linux - Software 1 05-03-2003 02:47 PM
Can't Upload FTP twantrd Linux - General 1 03-28-2003 09:15 PM
ftp upload hotrodowner Linux - Networking 20 10-11-2002 04:23 PM


All times are GMT -5. The time now is 01:56 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration