Hi Niphlod --

Thank you for pointing me in the right direction.  Although my application 
is too complicated to simplify (or more likely I'm not skilled enough to do 
it quickly) I was able to create a simple "form" example like you tested 
and put breakpoints in WingIDE to find out what is actually going on.

I discovered the place in SQLFORM.accepts() where the dirty work is done 
and what is needed to replace it.  Here's the code for those who follow 
this thread later... (if anyone is crazy enough!)

newfilename = field.store(source_file, original_filename,
                         field.uploadfolder)
fields[fieldname] = newfilename
if isinstance(field.uploadfield, str):
    fields[field.uploadfield] = source_file.read()


The var "field" in this case has been set to the table.upload field, so the 
variable "uploadfield" is tested to see if it is a string and the file is 
read into the blob data field if true.

I'll be able to test my application using DB-stored data now.  I'm not sure 
if its advantages will outweigh the drawbacks, but at least I can give it a 
proper try now.  Thanks again!

-- Joe B.

-- 

--- 
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/groups/opt_out.


Reply via email to