Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 06-25-2002, 09:05 AM   #1
Registered: Dec 2001
Location: Basel, Switzerland
Distribution: ubuntu
Posts: 297

Rep: Reputation: 31
ftp upload in php


i wrote this script:

<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\">

the ftp_upload.php contains this:

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!


Old 07-07-2002, 05:56 PM   #2
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 . An application server lets you easily keep variables in "application scope", so that multiple instances ( connection ) can access pooled resources.
Old 07-07-2002, 06:33 PM   #3
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 :


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

All times are GMT -5. The time now is 01:52 PM.

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