Recall that the suggestions to forego calling form.process() and instead 
just check for and directly manipulate request.vars.quotes_file was 
assuming you did not want to permanently store the file. If you do want to 
keep the file, then you should call form.process() (or include code to 
manually save the file). However, it's not clear that you do really need to 
keep the file. Presumably whatever code you plan to use to process and 
store the data would first open the file and then work with the open file 
object -- instead, you should be able to work with the FieldStorage file 
object directly (i.e., request.vars.quotes_file.file).

Anthony

On Thursday, March 21, 2013 2:01:01 PM UTC-4, software.ted wrote:
>
> But the question again is where is the file stored, its not appearing in 
> the specified uploads directory for manipulation. What I want to do is 
> upload an excel sheet with specific columns of data, then get the data and 
> insert into db with similar columns
> On Mar 21, 2013 6:48 PM, "Anthony" <abas...@gmail.com <javascript:>> 
> wrote:
>
>>     if request.vars.quotes_file:
>>
>>
>> Sorry, I didn't realize this, but apparently if you do "if 
>> [cgi.FieldStorage object]" you get False rather than True, so instead try:
>>
>> if hasattr(request.vars.quotes_file, "file"):
>>
>> or
>>
>> import cgi
>> if isinstance(request.vars.quotes_file, cgi.FieldStorage)
>>
>>  
>>
>>> I have further noticed this error in the page source after making a 
>>> submit:
>>>  
>>>
>> var ajax_error_500 = 'An error occured, please <a 
>>> href="/testapp/default/index?**first_name=bggfbfg&amp;quotes_**
>>> file=FieldStorage%28%27quotes_**file%27%2C+%27rows+%282%29.**
>>> csv%27%2C+%27circular.**circular_no%2Ccircular.**recipients%2Ccircular.*
>>> *circular_title%2Ccircular.**circular_date%5Cr%5CnNAZ%2F1%**
>>> 2F2013%2CALL+MEMBERS+OF+STAFF%**2CLunch+to+be+served+at+the+**
>>> Motel%2C2013-03-01%5Cr%5Cn%27%**29">reload</a> the page' 
>>>
>>  
>> That is not an error -- it is just a Javascript variable that is 
>> automatically generated by web2py_ajax.html. It is there in case there is 
>> an Ajax error on the page, in which case it will be used to generate an 
>> error message. However, I notice there is an error in the code used to 
>> generate that variable -- it should not be including post_vars in the link 
>> URL, only get_vars (I have submitted a patch to correct that).
>>
>> Anthony
>>
>> -- 
>>  
>> --- 
>> 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+un...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

-- 

--- 
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