Now I understand. Thanks for the clarification. I think there is a bug in 
store on GAE. There is already an open ticket about this. Will take a look 
asap.

On Saturday, 2 March 2013 05:21:34 UTC-6, montgome...@gmail.com wrote:
>
> Sorry if that didn't make sense, let me try again.
>
> I have small ( < 100 kb) audio files that I am getting on the fly via the 
> gluon.tools.fetch method from a third party API. I want to insert them into 
> the uploads folder and create entries for them in the database (as if they 
> were data uploaded by users). I have been doing this via the store() method 
> and have had no problems during development.  On GAE, however, this is not 
> working.  Specifically, it is throwing a runtime error "you must specify a 
> Field(...,uploadfolder=...)".  My questions are as follows:
>
> 1) When using the store() method on GAE, what should the 'path' argument 
> be?
>
> 2) Since this problem appears when using the store() method to save 
> uploads to the database on GAE, but not when uploading files using SQLform, 
> it seems to be a glitch.  Is this the case, or am I missing something 
> obvious?
>
> Thanks again for the help.
>
> On Saturday, March 2, 2013 10:15:12 AM UTC+8, Massimo Di Pierro wrote:
>>
>> What do you mean? 
>>
>> On Friday, 1 March 2013 09:54:22 UTC-6, montgome...@gmail.com wrote:
>>>
>>> I just discovered that the insert works with the SQLform, but not 
>>> manually.  Any idea why that would be?  
>>>
>>> On Friday, March 1, 2013 12:35:08 PM UTC+8, montgome...@gmail.com wrote:
>>>>
>>>> So my app is getting some small audio files via the gluon.tools fetch 
>>>> method, and then storing them manually in the upload folder via the 
>>>> store() 
>>>> method. While this works fine on a local server, it doesn't seem to work 
>>>> on 
>>>> GAE.  It's throwing a runtime error: "you must specify a 
>>>> Field(...,uploadfolder=...)".  Looking at the DAL gluon, this seems to 
>>>> imply that there is no path specified for the upload folder, even though 
>>>> that should be a default argument for Field() regardless of backend.   
>>>> Anyone have any ideas why?
>>>>
>>>> Here is the code:
>>>>
>>>> audio_file = StringIO.StringIO(fetch(audio_url))
>>>> self.classcont_id = current.db.classcont.insert(...., quest_audio = 
>>>> current.db.classcont.quest_audio.store(audio_file, self.audio_name) ,....) 
>>>> current.db.commit()
>>>>
>>>> Thanks.
>>>>
>>>

-- 

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