Hi

Yes it is a React Native mobile app :)  Since it is using native iOS
components, it is not possible to right-click and look at the DOM (it
doesn't have one because it is not a web page rendered inside a web-view).
Neither can I look at the network tab, because I only get a bridge to the
console by using the React Native debugger. I guess it is using the
javascript bridge from native iOS/Andriod back to react-native to send
messages back and forth. I can't monitor network traffic by using the
Chrome Webtools.

The strange thing is that I do get a response using my code that there is a
storage object, but there isnt any file on my disk with the name shown in
the response. I also thought that since I am getting a 200 response and I
am getting a Storage object, that it would be saved to disk - but that
doesn't seem to be the case :( So it... confuses me...

On Mon, Mar 13, 2017 at 8:26 PM, Dave S <[email protected]> wrote:

>
>
> On Monday, March 13, 2017 at 12:10:32 PM UTC-7, Mika Sjöman wrote:
>>
>> Hi and thanks :)
>>
>> Ill try that later. But I need to keep the image outside of the db (not
>> in a blob field), and only keep a reference to the location of the image on
>> the disk. I am going to run a python script on the image I am uploading to
>> do OCR analysis triggered by the Scheduler, so I need the image on the
>> disk. How can I move the image to somewhere on the disk instead of saving
>> it in the db?
>>
>> Cheers
>>
>
>
> We may need to know more about your React Native tool.  If you were using
> the Web2Py upload support, it would (unless told otherwise) end up in a
> file, and whether you used defaults or specified a location you'd know
> where that file was.  It might help to look at the network traffic for the
> uploads, and see what URL the post is using.  (The browser's DevTools
> console should have a Network tab.  You can get to the console via
> right-click->inspect element on the page you're using.)
>
> I've had the briefest intro to React, so I don't know much about your
> component.
>
> Is this a mobile app, BTW?
>
> /dps
>
>
>
>>
>> On Monday, March 13, 2017 at 5:42:07 PM UTC+1, Leonel Câmara wrote:
>>>
>>> Something like this should work (I haven't tested it).
>>>
>>> # Model
>>> db.define_table('my_uploads',
>>>     Field('upload_field', 'upload')
>>> )
>>>
>>>
>>> # Controller
>>> def upload():
>>>     """ Store the upload and return an URL to see the new file """
>>>     stored_name = db.my_uploads.upload_field.store(request.vars['file[]'
>>> ])  # Note that Field.store works fine with cgi.FieldStorage
>>>     db.my_uploads.insert(upload_field=stored_name)
>>>     return URL('default', 'download', args=stored_name, scheme=True,
>>> host=True)
>>>
>>>
>>>
>>>
>>> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/7yCg0huUwXE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
-- 
Mvh/Sincerely yours

Mika Sjöman

Homepage: http://www.omfriheten.com, Learn Chinese at our website:
http://www.dominochinese.com

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to