instead of inserting it, you could write the file stream out to whereever you want.
It's really just a python cgi module object. so you can use all corresponding documentation to help look at this SO answer https://stackoverflow.com/questions/15947988/in-my-python-cgi-script-how-do-i-save-to-disk-a-file-uploaded-via-post-request On 8 January 2014 10:44, Brando <bhe...@trustcc.com> wrote: > Also, should it be possible to adapt this so that I could use > SQLFORM.factory instead of FORM? I notice this uploads the files to the > db. What would need to change so that I'm just pulling it to the local > disk? > > > > > > > > On Wednesday, January 8, 2014 7:18:28 AM UTC-8, Calvin Morrison wrote: > >> I just wrote my own way to do it yesterday which worked great. I would >> love it to go upstream. >> >> It's just a standard file upload with the multiple attribute. >> >> here's the entire thing: it spits out a form. >> >> my db looks like this: >> >> db.define_table('uploads', >> Field('username', 'string'), >> Field('filename', represent = lambda x, row: "None" if x == None else >> x[:45]), >> Field('up_file', 'upload', uploadseparate=True, >> requires=IS_NOT_EMPTY()), >> Field('up_date', 'datetime'), >> Field('up_size', 'integer', represent= lambda x, row: >> quikr_utils.sizeof_fmt(x) ), >> Field('notes', 'text')) >> >> >> my contorller >> >> def submit(): >> import datetime >> >> form = FORM(LABEL("File(s):"), INPUT(_name='up_files', _type='file', >> _multiple=''), BR(), LABEL("Notes:"), TEXTAREA(_name='notes'), >> BR(),INPUT(_type='submit')) >> >> if form.accepts(request.vars, formname="form"): >> >> if hasattr(request.vars, 'up_files'): >> if len(request.vars.up_files) > 0: >> >> files = request.vars['up_files'] >> if not isinstance(files, list): >> files = [files] >> >> for f in files: >> print f.filename >> up_file = db.uploads.up_file.store(f, f.filename) >> i = db.uploads.insert(notes=request.vars.notes, >> up_file=up_file,filename=f.filename, username = auth.user.email, >> up_date= datetime.datetime.now()) >> db.commit() >> >> redirect(URL('data', 'index')) >> else: >> form.errors.up_files = "No files selected" >> >> return dict(form=form) >> >> >> On 8 January 2014 10:14, Brando <bhe...@trustcc.com> wrote: >> >>> I'm trying to use >>> jQuery-File-Upload<http://blueimp.github.io/jQuery-File-Upload/>to >>> implement multiple file uploads. I'm using this >>> tutorial<http://in10min.blogspot.com/2013/04/web2py-implement-multiple-files-upload.html> >>> as >>> well as this sample app >>> HERE<https://bitbucket.org/xavrenard/multiupload_module/src>. >>> >>> >>> Is there something in the standard web2py build that would be preventing >>> the proper javascript or CSS from running? The sample app should work >>> right out of the box; however, no buttons are displayed. >>> >>> Has anyone successfully implemented this on web2py before? >>> >>> >>> >>> >>> >>> -- >>> 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+un...@googlegroups.com. >>> >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> -- > 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/groups/opt_out. > -- 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/groups/opt_out.