What am supposed to see in dir and type? So that I can debug On 24 Feb 2014 16:16, "Anthony" <abasta...@gmail.com> wrote:
> You'll have the check the JS framework docs to see how/where it is posting > the file (e.g., maybe via a separate Ajax request). > > On Monday, February 24, 2014 8:50:51 AM UTC-5, software.ted wrote: >> >> the output is: >> >> Dir: >> ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', >> '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', >> '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', >> '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', >> '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', >> '__setattr__', '__sizeof__', '__str__', '__subclasshook__', >> '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center', >> 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', >> 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', >> 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', >> 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', >> 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', >> 'upper', 'zfill'] >> >> type: <type 'str'> >> >> >> On Mon, Feb 24, 2014 at 3:40 PM, Anthony <abas...@gmail.com> wrote: >> >>> The output of type(request.vars.photo) and dir(request.vars.photo). >>> >>> >>> On Monday, February 24, 2014 8:33:44 AM UTC-5, software.ted wrote: >>> >>>> I am using dhtmlx (www.dhtmlx.com) framework. The component am using >>>> is dhtmlxform. I don't understand what you mean by class and attribute. >>>> On 24 Feb 2014 14:45, "Anthony" <abas...@gmail.com> wrote: >>>> >>>>> Can you provide information about the form processing tool? What is >>>>> the class and attributes of request.vars.photo? >>>>> >>>>> Anthony >>>>> >>>>> On Monday, February 24, 2014 7:36:17 AM UTC-5, software.ted wrote: >>>>>> >>>>>> Am using form processing tool. Which has a send method...what it >>>>>> actually does is make post/get to a url in the >>>>>> form.send("{{=URL('c','a')}}") >>>>>> >>>>>> So what happens in the controller is that I can access the form >>>>>> variables as follows: >>>>>> >>>>>> def a(): >>>>>> file_name = request.vars.file_name >>>>>> >>>>>> The framework has code examples of how to access the uploaded file in >>>>>> php and java >>>>>> >>>>>> Any ideas? >>>>>> On 24 Feb 2014 14:27, "Anthony" <abas...@gmail.com> wrote: >>>>>> >>>>>>> Ajax doesn't allow file uploads in forms. Are you using an Ajax file >>>>>>> upload widget on the client side? >>>>>>> >>>>>>> Anthony >>>>>>> >>>>>>> On Monday, February 24, 2014 2:35:02 AM UTC-5, software.ted wrote: >>>>>>>> >>>>>>>> I am extremely stuck on how to manage uploaded file, I have been >>>>>>>> working with web2py now for over a year and I like its flexibility, I >>>>>>>> have >>>>>>>> been working on an application that is ajax based using my own file. >>>>>>>> Now i >>>>>>>> have the following scenario i need help with: >>>>>>>> >>>>>>>> DB >>>>>>>> ======= >>>>>>>> >>>>>>>> db.create_table("person", Field("first_name"), Field("photo", >>>>>>>> "upload"), ...) >>>>>>>> >>>>>>>> Controller: >>>>>>>> >>>>>>>> def manage_person(): >>>>>>>> try: >>>>>>>> value = db.person.update_or_insert(id == request.vars.id, >>>>>>>> first_name=request.vars.first_name, photo=request.vars.photo, ...) >>>>>>>> except ...: >>>>>>>> >>>>>>>> return value >>>>>>>> >>>>>>>> Now my question is how do i move the upaded image to say the upload >>>>>>>> folder, i was thinking web2py will put the physical image in upload >>>>>>>> folder >>>>>>>> according to documentation but unfortunately folder is empty. The DB >>>>>>>> hower >>>>>>>> gets updated with a the following: C:\fakepath\xxxx.jpg. >>>>>>>> >>>>>>>> Any ideas? >>>>>>>> >>>>>>>> Kind regards, >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> ............................................................ >>>>>>>> ........................... >>>>>>>> Teddy Lubasi Nyambe >>>>>>>> Opensource Zambia >>>>>>>> Lusaka, ZAMBIA >>>>>>>> >>>>>>>> Cell: +260 97 7760473 >>>>>>>> website: http://www.opensource.org.zm >>>>>>>> >>>>>>>> ~/ >>>>>>>> Human Knowledge belongs to the world! - AntiTrust >>>>>>>> >>>>>>>> Man is a tool-using animal. Without tools he is nothing, with tools >>>>>>>> he is all - Thomas Carlyle 1795-1881 >>>>>>>> >>>>>>>> /~ >>>>>>>> >>>>>>> -- >>>>>>> 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+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+un...@googlegroups.com. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> >> >> -- >> ............................................................ >> ........................... >> Teddy Lubasi Nyambe >> Opensource Zambia >> Lusaka, ZAMBIA >> >> Cell: +260 97 7760473 >> website: http://www.opensource.org.zm >> >> ~/ >> Human Knowledge belongs to the world! - AntiTrust >> >> Man is a tool-using animal. Without tools he is nothing, with tools he is >> all - Thomas Carlyle 1795-1881 >> >> /~ >> > -- > 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.