As is, your code should generate an error because you haven't specified an
upload folder, which is required when passing new Field objects to
SQLFORM.factory. Try:
import os
SQLFORM.factory(Field("quotes", "upload", uploadfolder=os.path.join(
request.folder, 'uploads')))
If you don't want to save the file at all, though, then don't call
form.process(). Instead, just check for the uploaded file:
if request.vars.quotes:
manage_quotes(request.vars.quotes.file)
Anthony
On Wednesday, March 20, 2013 8:30:29 AM UTC-4, software.ted wrote:
>
> I want to upload a file to web2py and then manipulate it. I dont want to
> save it into the database...after manipulating it i want to delete it. How
> do i do that. I have been trying like this but all fails:
>
> Controller:
>
> def quotes():
> form = SQLFORM.factory(Field("quotes", "upload")
> if form.process().accepted:
> manage_quotes(form.vars.quotes)
> elif form.errors:
> response.flash = "form has error"
>
> After upload I cannot see the uploaded in the upload folder!
>
> regards
>
>
>
> --
>
> .......................................................................................
> Teddy Lubasi Nyambe
> Opensource Zambia
> Lusaka, ZAMBIA
>
> Cell: +260 97 7760473
> website: http://www.opensource.org.zm
>
> ~/
> Human Knowledge belongs to the world! - AntiTrust
>
> Man is a tool-using animal. Without tools he is nothing, with tools he is
> all - Thomas Carlyle 1795-1881
>
> /~
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.