How did you insert the images in the database? Which Python version
are you using?

It seems your fileupload field contains a serialized FieldStorage
object and not the web2py filename. This is very wrong.
The problem is not in the code you show but in the data you have in
db. Please show us more about your app, including model and how data
gets inserted.

Massimo


On Jun 21, 11:00 am, Yannick <[email protected]> wrote:
> Hello Mate,
> I seem to have a problem to upload Image file in the view... Here is
> an example of how I implement it...
>
> ### In the Controller ##
> def download():
>     import os
>     path=os.path.join(request.folder,'uploads',request.args[0])
>     return response.stream(path)
>
> def index():
>      photoSet = db(db.photo.id>0).select()
>      return photoSet
>
> ### In the View #####
>   {{for photo in photoSet:}}
>       <img src="{{=URL(r=request,f='download',
> args=photo.fileupload)}}">
>   {{pass}}
>
> #########################################################################
>
> I also follow instruction from thread like this one below and tried
> using the following code for the "Download":
> def download():
>       return response.download(request,db)
>
> http://groups.google.com/group/web2py/browse_thread/thread/2aff11d23d...
>
> I keep receiving a Bad Request message "400 Bad Request"  with link
> like this when debugging with "Firebug" 
> :http://127.0.0.1:8000/BU/Action/download/FieldStorage%28%27file%27%2C...
>
> Any idea will be must appreciated....
>
> Thanks You
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to