File Open / Save -> File Upload / Download?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

File Open / Save -> File Upload / Download?

Sophie424
Part of my app is an editor for some business objects. Eventually these
might be saved in a server-side repository, but for now the user saves file
on local filesystem.

I am thinking of doing:
- For "File-Open" (to build initial biz object in my app)
   - use something like in WAUploadTest
        html fileUpload callback: [ :file | ...]

- For "File-Save" (to save biz objects at end of user session)
   - any reasonable option here? anything like
        html fileDownload ...

Thanks - Sophie



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: File Open / Save -> File Upload / Download?

Sophie424
> - ... anything like
>        html fileDownload ...

And if not, what should I do with
    headers | response | other things
to send the serialized biz-obj back and have the browser prompt for a place
to save it? (I can send ascii if required, though I'd rather not).

Thanks - Sophie



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: File Open / Save -> File Upload / Download?

Philippe Marschall
In reply to this post by Sophie424
2008/1/27, itsme213 <[hidden email]>:

> Part of my app is an editor for some business objects. Eventually these
> might be saved in a server-side repository, but for now the user saves file
> on local filesystem.
>
> I am thinking of doing:
> - For "File-Open" (to build initial biz object in my app)
>    - use something like in WAUploadTest
>         html fileUpload callback: [ :file | ...]
>
> - For "File-Save" (to save biz objects at end of user session)
>    - any reasonable option here? anything like
>         html fileDownload ...

html anchor
    callback: [
        self session returnResponse: (WARespnse new
            contentType: "the content type";
            attachmentWithFileName: "the file name";
            nextPutAll: "your content";
            yourself) ];
    with: 'download'

An other option would be (from WAUploadTest):

                html anchor
                        document: file contents
                        mimeType: file contentType
                        fileName: file fileName;
                        with: file fileName , ' (' , file contentType toString , ')'.

Cheers
Philippe


> Thanks - Sophie
>
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: File Open / Save -> File Upload / Download?

Sophie424
"Philippe Marschall" <[hidden email]> wrote in message
>        self session returnResponse: (WARespnse new
>            contentType: "the content type";
>            attachmentWithFileName: "the file name";
>            nextPutAll: "your content";
>            yourself) ];

Many thanks!



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside