If you accept a form like FORM(INPUT(_type="file",_name="upload_f")) the form.vars.upload_f contain a cgi.FieldStorageObject with two attributes
form.vars.upload_f.file from which you can read() the content and form.vars.upload_f.filename (the original filename) You cannot store in database form.vars.upload_f but you can store the data and/or the filename On Sep 11, 7:53 am, ARCHIT <[email protected]> wrote: > Hi, > I am trying to upload files using FORM (donot want to use crud etc...) > in controllers like > FORM(INPUT(_type="file",_name="upload_f")) > then i am inserting the file so got to using db.insert() in my > database. > But all i get is a 'file' written in the database which when clicked > upon gives me 404 error. > Can anyone tell me how to do this. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" 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 -~----------~----~----~----~------~----~------~--~---

