There are always 2 directions.
Upload and Download.

Upload means that the server receives a file from a foreign destination. Therefor the method is called receive. Download means that the server sends a file to a foreign destination. Therefor the method is called send.

When you don't want to send a file to the client you can still echo it (display), but this is no download. Zend_File_Transfer does only handle file transfer and not file displaying needs.

Beside that the FTP adapter is not coded for now so there is no need to hassle about it. :-)

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "Paweł Chuchmała" <[EMAIL PROTECTED]>
To: <fw-general@lists.zend.com>
Sent: Tuesday, December 09, 2008 10:43 AM
Subject: [fw-general] Zend_File_Transfer proposal, send and receive


Hi.

I don't understand when I should use send() and receive() methods.
I think that send() should send file(s) from place where our application is
to another place.
And receive() should receive file to place where application is.
For example, if I want store at ftp server file from user uploaded by http
post, I do it like that:

$form->file->receive();

$files = new Zend_File_Transfer('FTP', array('user' => 'adam', 'pwd' =>
'sandler', 'server' => 'ftp.myserver.com/public'));
$files->addFiles($form->file->getFileName)
 ->send();

But in examples from proposal we have:
FTP Download:
"The API can also be used for downloads. It will work as wrapper so the user
does not see where the original files is located and ZF will send the file
to the user."
and it use send(). I think it should use receive() to receive file from ftp,
and then send it to user by echoing content or something else, but nod
send() method from FTP adapter.

Kind, regards,
pch

--
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Reply via email to