Yes I did both but I kept getting the same output no matter what I did.

//Cheers

Den 14 mars 2017 00:18 skrev "Dave S" <snidely....@gmail.com>:

>
>
> On Monday, March 13, 2017 at 2:51:08 PM UTC-7, Mika Sjöman wrote:
>>
>> I tried that (up_file = request.vars['file[]']), but I still just get
>> the String printed out in my console:
>>
>> "FieldStorage('file[]', 'mikasworld.jpg', '\xff\...base64 representation
>> of the image.
>>
>>
> After you got that, did you print up_file.file and up_file.filename?
>
> The strange thing is that the upload seems to go all right, but it never
>> saves the file. If I remember right, uploaded files just appears in the
>> /upload folder once complete, but this doesn't happen here. Strange....
>>
>
> Remember that web2py likes to munge the names of the uploaded files, both
> to avoid dangerous names and to limit
>
>
>> I am getting this ouput in my console, so for sure it upload the file and
>> given the request.vars response, it seems like the server is accepting the
>> upload but not saving the file. This is my output during the upload:
>>
>> upload progress: 19.57139819860458%
>> ImageViewer.js:75 upload progress: 39.14279639720917%
>> ImageViewer.js:75 upload progress: 58.71419310569763%
>> ImageViewer.js:75 upload progress: 78.28559279441833%
>> ImageViewer.js:75 upload progress: 97.85698652267456%
>> ImageViewer.js:75 upload progress: 100%
>>
>> Any ideas on why I get a FieldStorage object but not a saved file to disk
>> on the server? Is there any step I need to take after the file has been
>> uploaded that finally saves the file to disk?
>>
>>
>> On Mon, Mar 13, 2017 at 9:23 PM, Leonel Câmara <leonel...@gmail.com>
>> wrote:
>>
>>> Sorry I assumed you wanted it in the DB you don't want it in the DB. You
>>> can just manipulate the file directly and save it whoever you want, you
>>> have a cgi.FieldStorage in request.vars['file[]'] you can use it to access
>>> the uploaded file.
>>>
>>> up_file = request.vars['file[]']
>>> up_file.file  # will have a file object you can use to read the data and
>>> write it to disk
>>> up_file.filename # wil have the uploaded file filename
>>> [...]
>>>
>> --
>>>
>> --
>> Mvh/Sincerely yours
>>
>> Mika Sjöman
>>
>> Homepage: http://www.omfriheten.com, Learn Chinese at our website:
>> http://www.dominochinese.com
>>
>>
>>
> [google groups doesn't understand sig delimiters.  Pity]
>
> /dps
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/7yCg0huUwXE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to