Transfer plain text files with pyAMF

View: New views
5 Messages — Rating Filter:   Alert me  

Transfer plain text files with pyAMF

by vitaly-18 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
is it possible to transfer plain text files(for example *.ics file  
extension) with pyAMF and how?
Example will be appreciated.

Thanks.

_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

Re: Transfer plain text files with pyAMF

by Nick Joyce :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, this is possible, use a ByteArray for example:

from pyamf import amf3

def read_file():
     name = 'cal.ics'

     f = file(name, 'rb')

     ba = am3.ByteArray(f.read())

     # will compress the file using zlib
     ba.compress()

     return ba

Hth,

Nick

On 19 Aug 2009, at 18:57, vitaly@... wrote:

> Hi,
> is it possible to transfer plain text files(for example *.ics file  
> extension) with pyAMF and how?
> Example will be appreciated.
>
> Thanks.
>
> _______________________________________________
> PyAMF users mailing list - users@...
> http://lists.pyamf.org/mailman/listinfo/users

_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

Re: Transfer plain text files with pyAMF

by vitaly-18 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you,
and if to continue the idea:
on the client side the FLEX will need to read ByteArray, decompress  
content and cal.ics will became an RFC2445 format (as it was on server  
side in cal.ics)?

Quoting "Nick Joyce" <nick@...>:

> Yes, this is possible, use a ByteArray for example:
>
> from pyamf import amf3
>
> def read_file():
>     name = 'cal.ics'
>
>     f = file(name, 'rb')
>
>     ba = am3.ByteArray(f.read())
>
>     # will compress the file using zlib
>     ba.compress()
>
>     return ba
>
> Hth,
>
> Nick
>
> On 19 Aug 2009, at 18:57, vitaly@... wrote:
>
>> Hi,
>> is it possible to transfer plain text files(for example *.ics file  
>> extension) with pyAMF and how?
>> Example will be appreciated.
>>
>> Thanks.
>>
>> _______________________________________________
>> PyAMF users mailing list - users@...
>> http://lists.pyamf.org/mailman/listinfo/users
>
> _______________________________________________
> PyAMF users mailing list - users@...
> http://lists.pyamf.org/mailman/listinfo/users
>


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

Re: Transfer plain text files with pyAMF

by vitaly-18 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you a lot!

Quoting "Nick Joyce" <nick@...>:

> Yep, that is the idea.
>
> Cheers,
>
> Nick
>
> On 19 Aug 2009, at 19:56, vitaly@... wrote:
>
>> Thank you,
>> and if to continue the idea:
>> on the client side the FLEX will need to read ByteArray, decompress  
>>  content and cal.ics will became an RFC2445 format (as it was on  
>> server side in cal.ics)?
>>
>> Quoting "Nick Joyce" <nick@...>:
>>
>>> Yes, this is possible, use a ByteArray for example:
>>>
>>> from pyamf import amf3
>>>
>>> def read_file():
>>>   name = 'cal.ics'
>>>
>>>   f = file(name, 'rb')
>>>
>>>   ba = am3.ByteArray(f.read())
>>>
>>>   # will compress the file using zlib
>>>   ba.compress()
>>>
>>>   return ba
>>>
>>> Hth,
>>>
>>> Nick
>>>
>>> On 19 Aug 2009, at 18:57, vitaly@... wrote:
>>>
>>>> Hi,
>>>> is it possible to transfer plain text files(for example *.ics  
>>>> file  extension) with pyAMF and how?
>>>> Example will be appreciated.
>>>>
>>>> Thanks.
>>>>
>>>> _______________________________________________
>>>> PyAMF users mailing list - users@...
>>>> http://lists.pyamf.org/mailman/listinfo/users
>>>
>>> _______________________________________________
>>> PyAMF users mailing list - users@...
>>> http://lists.pyamf.org/mailman/listinfo/users
>>>
>>
>>
>> _______________________________________________
>> PyAMF users mailing list - users@...
>> http://lists.pyamf.org/mailman/listinfo/users
>
> _______________________________________________
> PyAMF users mailing list - users@...
> http://lists.pyamf.org/mailman/listinfo/users
>


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

Re: Transfer plain text files with pyAMF

by Nick Joyce :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yep, that is the idea.

Cheers,

Nick

On 19 Aug 2009, at 19:56, vitaly@... wrote:

> Thank you,
> and if to continue the idea:
> on the client side the FLEX will need to read ByteArray, decompress  
> content and cal.ics will became an RFC2445 format (as it was on  
> server side in cal.ics)?
>
> Quoting "Nick Joyce" <nick@...>:
>
>> Yes, this is possible, use a ByteArray for example:
>>
>> from pyamf import amf3
>>
>> def read_file():
>>    name = 'cal.ics'
>>
>>    f = file(name, 'rb')
>>
>>    ba = am3.ByteArray(f.read())
>>
>>    # will compress the file using zlib
>>    ba.compress()
>>
>>    return ba
>>
>> Hth,
>>
>> Nick
>>
>> On 19 Aug 2009, at 18:57, vitaly@... wrote:
>>
>>> Hi,
>>> is it possible to transfer plain text files(for example *.ics  
>>> file  extension) with pyAMF and how?
>>> Example will be appreciated.
>>>
>>> Thanks.
>>>
>>> _______________________________________________
>>> PyAMF users mailing list - users@...
>>> http://lists.pyamf.org/mailman/listinfo/users
>>
>> _______________________________________________
>> PyAMF users mailing list - users@...
>> http://lists.pyamf.org/mailman/listinfo/users
>>
>
>
> _______________________________________________
> PyAMF users mailing list - users@...
> http://lists.pyamf.org/mailman/listinfo/users

_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users