Android Example Select,Upload,Display,Delete image from Server

MohammadNew

Active Member
Licensed User
Hello everyone,

First of all, I want thank Erel, DonManfred and KMatle because a lot of the codes for them.

In this example (Select an image from gallery and display it, Resize the image, Save the image from Imageview to app's folder, Upload the image to the server, Display the image from the server, Delete the image from the server and last choice Delete all images from the server.

## Note:

You should upload php files directly in your website not in sub folder.
Create folder "uploads" together in same place.
Change "xxxx" from the url to your url.




I update the app > get images as list in ListView and click on it to display the image.




I hope this example help you.
 

Attachments

Last edited:

Alexander Stolte

Well-Known Member
Licensed User
It could be an alternative to firebase storage, depends on how much Firebase wants to end up having money when the app is out, thanks for it!
 

KMatle

Expert
Licensed User
You should upload php files directly in your website not in sub folder.
Why? For security reasons you should store any data in subfolders which are protected with a pw. Another reason is to organize the pics (like you don't store everythin on your desktop :) ). Anyway: Nice example
 

MohammadNew

Active Member
Licensed User
Why? For security reasons you should store any data in subfolders which are protected with a pw. Another reason is to organize the pics (like you don't store everythin on your desktop :) ). Anyway: Nice example
Hello KMatle, good point the security. But I mean the new users to do it step by step and we can put php files everywhere then refer the place in our link.

Thanks KMatle
 

tsteward

Active Member
Licensed User
There seems to be a problem with the php file "Multipartpost.php" $file_handle is never given a value and Null causes issues.
I don't know how to resolve this

Response from server: ["chip.jpg","gralogo.JPG","mack.jpg","Spring.jpg"]
<br />
<b>Warning</b>: fwrite() expects parameter 1 to be resource, null given in <b>/srv/disk9/1833309/www/XXX.com/multipartpost.php</b> on line <b>54</b><br />
<br />
<b>Warning</b>: fwrite() expects parameter 1 to be resource, null given in <b>/srv/disk9/1833309/www/XXX.com/multipartpost.php</b> on line <b>58</b><br />
<br />
 

DonManfred

Expert
Licensed User
There seems to be a problem with the php file "Multipartpost.php" $file_handle is never given a value and Null causes issues.
he copied parts of an old php script of mine (See Multipart fileupload link in my Signature). The lines where the logfile is generated are missing. Due to this $file_handle is not set...
Remove/comment the lines or add a
PHP:
$file_handle = fopen('./logs/mylogfile_'.date("Y-W", time()).'.log', 'a+');
somewhere at the beginning.
 
Top