file upload

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

file upload

squeakman
Hi,

I have the following code:

html form: [ html fileUpload
              callback: [:f | self halt].
              html submitButton text: 'Load'].

When I select a file for uploading and the callback is executed I see
that the file returned to me is not the full pathname.

Is there a way to get the full pathname of the selected file?

Thanks,
Frank

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

Re: file upload

Randal L. Schwartz
>>>>> "Squeaker" == Squeaker  <[hidden email]> writes:

Squeaker> When I select a file for uploading and the callback is executed I see that the
Squeaker> file returned to me is not the full pathname.

Squeaker> Is there a way to get the full pathname of the selected file?

You mean the client-provided pathname?  The meaningless arbitary string
of characters?

If so, no, and that's a good thing.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: file upload

Boris Popov, DeepCove Labs (SNN)
What Randal is trying to say is that this is intentionally not provided
by the browser for security reasons.

:)

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Randal L. Schwartz
> Sent: Friday, February 15, 2008 1:15 PM
> To: Squeaker
> Cc: [hidden email]
> Subject: Re: [Seaside] file upload
>
> >>>>> "Squeaker" == Squeaker  <[hidden email]> writes:
>
> Squeaker> When I select a file for uploading and the callback is
executed
> I see that the
> Squeaker> file returned to me is not the full pathname.
>
> Squeaker> Is there a way to get the full pathname of the selected
file?
>
> You mean the client-provided pathname?  The meaningless arbitary
string

> of characters?
>
> If so, no, and that's a good thing.
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
> 0095
> <[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
> training!
> _______________________________________________
> 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 upload

squeakman
Boris Popov wrote:
> What Randal is trying to say is that this is intentionally not provided
> by the browser for security reasons.
>
> :)
>
> -Boris
>

Thanks to you both (Randall and Boris).  I was going down the wrong
path, you comment made me realize it.

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

Re: file upload

Avi Bryant-2
In reply to this post by Boris Popov, DeepCove Labs (SNN)
On 2/15/08, Boris Popov <[hidden email]> wrote:
> What Randal is trying to say is that this is intentionally not provided
> by the browser for security reasons.

Except IE, which does provide it, which is why WAFile>>fileName goes
out of its way to get rid of that :)

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

RE: file upload

Boris Popov, DeepCove Labs (SNN)
Heh, now that I look at it, indeed.

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Avi Bryant
> Sent: Friday, February 15, 2008 2:31 PM
> To: Seaside - general discussion
> Subject: Re: [Seaside] file upload
>
> On 2/15/08, Boris Popov <[hidden email]> wrote:
> > What Randal is trying to say is that this is intentionally not
provided

> > by the browser for security reasons.
>
> Except IE, which does provide it, which is why WAFile>>fileName goes
> out of its way to get rid of that :)
>
> Avi
> _______________________________________________
> 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 upload

Lukas Renggli
In reply to this post by squeakman
>  html form: [ html fileUpload
>               callback: [:f | self halt].
>               html submitButton text: 'Load'].

I wonder how this callback is trigger **at all**, if you don't declare
the form as being multipart?

Lukas

--
Lukas Renggli
http://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: file upload

squeakman
Lukas Renggli wrote:
>>  html form: [ html fileUpload
>>               callback: [:f | self halt].
>>               html submitButton text: 'Load'].
>
> I wonder how this callback is trigger **at all**, if you don't declare
> the form as being multipart?
>
> Lukas
>
Could you explain why it has to be part of a multipart form?  I hope the
answer is not too obvious :)

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

Re: Re: file upload

cedreek
>  > I wonder how this callback is trigger **at all**, if you don't declare
>  > the form as being multipart?
>  >
>  > Lukas
>  >
>
> Could you explain why it has to be part of a multipart form?  I hope the
>  answer is not too obvious :)

not too obvious (wasn't really aware of it) but documented in the
method ;) Searching is not so easy... to find the method I searched
for selectors containing multipart (cmd+shift+w), then (there are
some) I had to find the class where it's defined...
Google helped me too :)

WAForemTag>>multipart
        "Sets the content type used to submit the form to the server (when
the value of method is 'post') to multipart/form-data instead the
default application/x-www-form-urlencoded. This should be used in
combination with a WAFileUploadTag."
        self attributeAt: 'enctype' put: 'multipart/form-data'

more information here:
http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2

"The content type "application/x-www-form-urlencoded" is inefficient
for sending large quantities of binary data or text containing
non-ASCII characters. The content type "multipart/form-data" should be
used for submitting forms that contain files, non-ASCII data, and
binary data."



Cédrick

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