Error when exporting saved photos in SQLite to Mysql remote server

Very interesting solution, @TIMAI2 . I'll try this way and tell you the results.

Thank you very much for your time and suggestion.

@TIMAI2 I just have a doubt: When i choose the camera to take a picture, the filepath comes like:

file:///storage/emulated/0/...........

And when I choose from gallery, the filepath comes like:

/storage/emulated/0/..........

And I am using this block in the two fields:

Maybe the error I am facing is because of this... or am I wrong?

What is the error?

It is in the first post

image

should be OK, possibly something else causing the error. Will be needed for the camera file path.

You would need to isolate where the error arises (debug)

You could also use just one instance o ImageConvertor for the resizing, just call the second resize from the event of the first (use a variable to define which one is being called, e.g. first, second)

1 Like

Ok, I did this for both fields:

And problem is solved! Thank you very much @TIMAI2

If there is no file://, nothing will be replaced.

1 Like

Hi @Anke , the way you showed was my first try. But the error (in the first post) came out and when I changed to this way, it worked.

Be aware that if you are using ImagePicker it only stores the last 10 files. Thus, if you are saving more than ten files to sqlite, the earliest ones will no longer exist. To overcome this see here:

If you are using FilePicker then this returns a contenturi which may not be readable by most extensions (because the contenturi needs to be converted to a file path).

My guess is that you perhaps needed to dig deeper with your debugging in order to check the file paths being returns and that the file actually exists.

1 Like

That doesn't make any sense at all. :woman_shrugging: :upside_down_face:

1 Like

Thanks for advice. In my case, only 2 pictures for record are stored. It is like "PICTURE BEFORE and PICTURE AFTER".

I agree with you, but the error put me on that new way...

Yes, but how many records ?

Not more than one. The project consists in the user take a picture from a place before the job he is gonna do and after the job done, take another picture after the job. And after got this 2 images, send them to the server and delete from SQLite.

1 Like

Fun as it is, you do not need sqlite for this, or tinydb for that matter, just cut out those steps and use variables...or re-reading, you may actually need tinydb given the time between the pictures taken etc

It could be, but (there is always a BUT), the user can take pictures in places which does not have internet, but he has to save until he arrives in a WIFI place or something similar, to send all data to the remote server. That's why I choose SQLite for this.

1 Like

tinydb is a local database on the device.

1 Like

SQLite and MySQL are relational databases and use the SQL language. And we use a lot of SQL in WEB development. Right Kleyber ?

Yes. That's right

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.