On Tue, Dec 9, 2008 at 16:19, Thomas Weidner <[EMAIL PROTECTED]> wrote:

> Pawel,
>
> I don't get the point.
>
> You said that the user uploads the file via HTTP to the server.
> So it's stored on the server as real file.

Then you said that you can not filter because the file is not stored on the
> server ?
>

Yes, it's stored, but I want to send it to Mogile storage and delete form
server.


> I don't know any extension which stored a uploaded file directly on Mogile
> or any other filesystem beside that where PHP resists. I think you completly
> misunderstood how the file transfer generally works.
>

I don't know too, that's why I want first receive file via http adapter, and
then send it to Mogile via my adapter. Two diffrent adapters.


> Related to filtering itself the order is fixed:
> validation -> filter -> send
> or
> validation->receive->filter
> or
> validation -> receive -> filter -> send


Ok, how I can do:
validation -> receive -> filter -> send
when I want receive and send via different adapters?
I think, I must break it:
1 adapter:
validation -> receive (filter is unnecessary, cause I send file and delete
from server)
2 adapter
filter -> send

I don't understand how filters from release 1.7.0 can work with send().
Forget about Mogile, take ftp, where filesystem have directories etc. What
is misiing or behave dofferent, what I must to write or rewrite to receive
file via one adapter and send it by another?


> All other handlings would not work when using different adapters.
> But you should be aware of one thing... the download handling is not
> integrated for now so it is possible that it changes due to other needs of
> integrated adapters. (Not the method itself but probably how things work
> internally).
>

I know, that's why I want to do more similary as it will be done in
framework.

>
> 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 4:02 PM
> Subject: Re: [fw-general] Zend_File_Transfer proposal, send and receive
>
>
>  I have questions ho implement some methods.
>>
>> I want to send file to MogileFs system. I write adapter for it. Scnario
>> is:
>>
>> 1. receive file via user form (http_adapter::receive())
>> 2. add file to my adapter: $file->addFile($form->file->getFileName());
>> 3. add filters: $file->addFilter('Rename', '/something\c:\veryStrange/');
>> 4. send it to MogileFs: $file->send().
>>
>> I write send() method and first question: should I apply filters before
>> send?
>> Another problem. File in MogileFS are stored in flat structure. There
>> are'nt
>> directories, filenames, etc. I can't use
>> method Zend_File_Transfer_Adapter_Abstract::_filter(), because it use
>> dirname() and filename() to choose destination and name.
>> I cant use Zend_Filter_File_Rename, cause it work on files in system. If I
>> receive file it's ok. But if I want send it somewhere,
>> I want to change only array that describe my file.
>>
>> Filenames (for true I should say 'virtual filenames') in MogileFs nad
>> Amazon
>> S3 can be like point 3. above, so if I want send file to them, shouldn't
>> be
>> validated as file for store in 'traditional' file systems.
>>
>> How I can do this, in Zend Framework convention?
>>
>> regards,
>> pch
>>
>>
>>
>> 2008/12/9 Thomas Weidner <[EMAIL PROTECTED]>
>>
>>  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'<http://ftp.myserver.com/public%27>
>>>> )<http://ftp.myserver.com/public%27%29>
>>>> );
>>>> $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
>>>>
>>>>
>>>>
>>>
>>
>> --
>> Paweł Chuchmała
>> pawel.chuchmala at gmail dot com
>>
>>
>


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

Reply via email to