Choose Directory Window

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

Choose Directory Window

Alexandre BP
Hi,

I'd like to open a new window from my webpage to ask the user to choose a directory where he wants to save a file.

I tried this:

canvas submitButton
callback:[
fileWindow := FileDialogWindow new.
directoryPath := fileWindow chooseDirectory:'Choose a directory'.];
with:'Choose directory'.

It works but the window is open in pharo and not on my website.
How can I change that?
Thx in advance.
alex

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

RE: Choose Directory Window

Robert Sirois
WAFileUploadTag

" I think you end up with a WAFile instance or something? I'd have to look, but you can always just explore it "
html fileUpload
    on: #iVar of: self.

RS


From: [hidden email]
Date: Sat, 4 Dec 2010 16:41:16 +0100
Subject: [Seaside] Choose Directory Window
To: [hidden email]

Hi,

I'd like to open a new window from my webpage to ask the user to choose a directory where he wants to save a file.

I tried this:

canvas submitButton
callback:[
fileWindow := FileDialogWindow new.
directoryPath := fileWindow chooseDirectory:'Choose a directory'.];
with:'Choose directory'.

It works but the window is open in pharo and not on my website.
How can I change that?
Thx in advance.
alex

_______________________________________________ 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: Choose Directory Window

Alexandre BP
Thx but actually I'd like to choose the directory (not a file) so that the user can download the file (which comes from my website) where he wants.
Alex

2010/12/4 Robert Sirois <[hidden email]>
WAFileUploadTag

" I think you end up with a WAFile instance or something? I'd have to look, but you can always just explore it "
html fileUpload
    on: #iVar of: self.

RS


From: [hidden email]
Date: Sat, 4 Dec 2010 16:41:16 +0100
Subject: [Seaside] Choose Directory Window
To: [hidden email]


Hi,

I'd like to open a new window from my webpage to ask the user to choose a directory where he wants to save a file.

I tried this:

canvas submitButton
callback:[
fileWindow := FileDialogWindow new.
directoryPath := fileWindow chooseDirectory:'Choose a directory'.];
with:'Choose directory'.

It works but the window is open in pharo and not on my website.
How can I change that?
Thx in advance.
alex

_______________________________________________ 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



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

Re: Choose Directory Window

Lukas Renggli
The security model of HTTP/JavaScript does not allow such a thing.
This is the web-browser that does the handling of the downloaded file
automatically. Possibly there is a way to circumvent that with
Flash/Java, but that's not advisable in my opinion.

Lukas

On 4 December 2010 13:54, alexandre bp <[hidden email]> wrote:

> Thx but actually I'd like to choose the directory (not a file) so that the
> user can download the file (which comes from my website) where he wants.
> Alex
>
> 2010/12/4 Robert Sirois <[hidden email]>
>>
>> WAFileUploadTag
>>
>> " I think you end up with a WAFile instance or something? I'd have to
>> look, but you can always just explore it "
>> html fileUpload
>>     on: #iVar of: self.
>>
>> RS
>>
>> ________________________________
>> From: [hidden email]
>> Date: Sat, 4 Dec 2010 16:41:16 +0100
>> Subject: [Seaside] Choose Directory Window
>> To: [hidden email]
>>
>> Hi,
>> I'd like to open a new window from my webpage to ask the user to choose a
>> directory where he wants to save a file.
>> I tried this:
>> canvas submitButton
>>
>> callback:[
>>
>> fileWindow := FileDialogWindow new.
>>
>> directoryPath := fileWindow chooseDirectory:'Choose a directory'.];
>>
>> with:'Choose directory'.
>>
>> It works but the window is open in pharo and not on my website.
>> How can I change that?
>> Thx in advance.
>> alex
>> _______________________________________________ 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
>>
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>



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

Re: Choose Directory Window

Alexandre BP
Ok I didn't know that.
So, in other words, here is the situation:
  • A user wants to export something from my website.
  • He clicks on the button 'export' that I created.
  • I have implemented that when this button is clicked, a file is created and a content is written in it, then the file is closed.
  • The web-browser is going to ask where the user wants to put the file or is going to put it in a default directory automatically?
Thank you for your answer :)
cheers
alex


2010/12/4 Lukas Renggli <[hidden email]>
The security model of HTTP/JavaScript does not allow such a thing.
This is the web-browser that does the handling of the downloaded file
automatically. Possibly there is a way to circumvent that with
Flash/Java, but that's not advisable in my opinion.

Lukas

On 4 December 2010 13:54, alexandre bp <[hidden email]> wrote:
> Thx but actually I'd like to choose the directory (not a file) so that the
> user can download the file (which comes from my website) where he wants.
> Alex
>
> 2010/12/4 Robert Sirois <[hidden email]>
>>
>> WAFileUploadTag
>>
>> " I think you end up with a WAFile instance or something? I'd have to
>> look, but you can always just explore it "
>> html fileUpload
>>     on: #iVar of: self.
>>
>> RS
>>
>> ________________________________
>> From: [hidden email]
>> Date: Sat, 4 Dec 2010 16:41:16 +0100
>> Subject: [Seaside] Choose Directory Window
>> To: [hidden email]
>>
>> Hi,
>> I'd like to open a new window from my webpage to ask the user to choose a
>> directory where he wants to save a file.
>> I tried this:
>> canvas submitButton
>>
>> callback:[
>>
>> fileWindow := FileDialogWindow new.
>>
>> directoryPath := fileWindow chooseDirectory:'Choose a directory'.];
>>
>> with:'Choose directory'.
>>
>> It works but the window is open in pharo and not on my website.
>> How can I change that?
>> Thx in advance.
>> alex
>> _______________________________________________ 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
>>
>
>
> _______________________________________________
--
Lukas Renggli
www.lukas-renggli.ch
_______________________________________________


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

Re: Choose Directory Window

Lukas Renggli
> The web-browser is going to ask where the user wants to put the file or is
> going to put it in a default directory automatically?

This depends on various things what the web browser does: the web
browser, the user preferences, the mime-type, ...

Lukas

--
Lukas Renggli
www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside