Re: SISCweb & File Upload

"Gerardo Horvilleur" <[email protected]> Mon, 21 Jul 2008 11:53:47 -0500
Newsgroups gmane.comp.java.sisc.user
Message-ID <[email protected]>
I guess that the easiest work around is to change my application and
have a special page to upload pictures, so I don't have to mix file
uploads and other kinds of fields in a single request.

On Mon, Jul 21, 2008 at 2:27 AM, Gerardo Horvilleur <[email protected]> wrote:
> I've been doing a few tests and I have a problem. In order to be able
> to upload files y must declare the form's enctype to be
> multipart/form-data:
>
> (form (@ (action ,k-url) (enctype multipart/form-data)) ...
>
> But, once I do this, get-bindings isn't able anymore to extract the
> bindings from the request object. It just returns an empty map.
>
> On Sun, Jul 20, 2008 at 11:16 PM, Alessandro Colomba <[email protected]> wrote:
>> Gerardo,
>>
>> The request object returned by the some of the send-*/* procedures is
>> the actual HttpServletResponset object. You can most certainly place
>> more than one call to it.
>>
>> The response object is also always available through the
>> (current-response) procedure in the siscweb/response module. [*] So
>> your file upload module does not technically need to be passed the
>> response object, and you can keep the (get-bindings) call n place.
>>
>> Hope this helps,
>> ___
>> Alessandro
>>
>> [*] http://siscweb.sourceforge.net/swm/ch08.html#response
>>
>>
>>
>> On Sun, Jul 20, 2008 at 1:38 AM, Gerardo Horvilleur <[email protected]> wrote:
>>> The Apache Commons File Upload library is what I have used in other
>>> projects written in Java.
>>>
>>> So, it looks like I''ll have to do something like
>>>
>>> (let ((request (send-thml/suspend ...
>>>
>>> instead of doing
>>>
>>> (let ((bindings (get-bindings (send-html/suspend ...
>>>
>>> so I can give the request to the file upload library to extract the data.
>>>
>>> What I don't know is if, after I've used the request object with the
>>> file upload library, I still can do a a
>>>
>>> (let ((bindings (get-bindings request))) ...
>>>
>>> To extract the values for the parameters which are not file uploads.
>>>
>>> All the pages in which I need to support file uploads also have many
>>> other fields, and I would like to still be able to use get-bindings to
>>> handle them.
>>>
>>> On Sat, Jul 19, 2008 at 8:31 PM, Alessandro Colomba <[email protected]> wrote:
>>>> Gerardo,
>>>>
>>>> Unfortunately file uploads in J2EE are best handled through
>>>> third-party libraries, and I really did not want to tie SISCweb to
>>>> one. Apache Commons has a pretty good library (FileUpload), and I
>>>> wouldn't imagine difficult to write a Scheme wrapper around it.
>>>>
>>>> Should you decide to go this route, and encounter any obstacles in
>>>> SISCweb, please let me know. I'll be glad to clear them out.
>>>>
>>>> Regards,
>>>> ___
>>>> Alessandro
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Sat, Jul 19, 2008 at 6:14 PM, Gerardo Horvilleur <[email protected]> wrote:
>>>>> For the application I'm writing, I need to let the user upload images
>>>>> to the server. I haven't found any straightforward way to handle file
>>>>> uploads in SISCweb. Has anybody already written some code to handle
>>>>> this?
>>>>>
>>>>> --
>>>>> Gerardo Horvilleur
>>>>> [email protected]
>>>>> 5813-0830
>>>>>
>>>>> -------------------------------------------------------------------------
>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>> _______________________________________________
>>>>> Sisc-users mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/sisc-users
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Gerardo Horvilleur
>>> [email protected]
>>> 5813-0830
>>>
>>
>
>
>
> --
> Gerardo Horvilleur
> [email protected]
> 5813-0830
>



-- 
Gerardo Horvilleur
[email protected]
5813-0830

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/