PHP Script

This PHP script is used both for uploading and downloading files. When the script is installed and you the type the full address of the upload webpage, you will get something like this:

php.ini: upload_max_filesize = 200M
php.ini: post_max_size = 100M
No file uploaded

With this utility you can upload or download your files to and from your android device and another computer with a web server. Note that the directory (folder) where the files is stored is called "upload". Only certain file types can be uploaded. ( gif ,jpeg ,jpg ,png ,pdf ,doc ,txt ,csv ,gpx ,xml ,db)


Files available for download:
Filename Date uploaded File size
HOME15-May-2013 040048.gpx 2013-07-06 07:49:34 7704618
home15-May-2013T063030.gpx 2013-07-06 07:48:42 1284716
toll.csv 2013-08-07 04:56:55 2046
visits.csv 2013-06-04 05:04:57 16968
waypoints.csv 2013-07-10 04:51:44 3206
waypoints10Jul2013T045827.csv 2013-07-10 04:52:05 3206
work.db 2013-07-06 08:14:12 41627648

AVAILABLE FILES FOR DOWNLOAD:
1373089774 , 7704618 , upload/HOME15-May-2013 040048.gpx
1373089722 , 1284716 , upload/home15-May-2013T063030.gpx
1375844215 , 2046 , upload/toll.csv
1370315097 , 16968 , upload/visits.csv
1373424704 , 3206 , upload/waypoints.csv
1373424725 , 3206 , upload/waypoints10Jul2013T045827.csv
1373091252 , 41627648 , upload/work.db
END OF FILES 

I am outputting the php.ini setup values upload_max_filesize and post_max_size for your convenience because these values give a lot of problems when trying to upload big files. (The upload fails and you have no idea why.) After this, some more information of what is allowed to be uploaded is shown. From this android application, we just upload CSV, DB, GPX and XML files, but I allowed some other files to be uploaded as well. After this there is a table of all the files that were uploaded before. Here you can click on any file to download it to your computer. The file upload time and size is also displayed. This information is repeated once again but in a different format. This different format is made for the android application to find the files that is available for download. The words just before and just after are used by the android application to find this file information. Anyone modifying this php script should take this into account. (This script can be used to implement your own cloud storage. It is free for use.)

The PHP script is as follows:

The procedure for installing this on a linux server will be as follows: (In the examples below we assume that the web servers root directory is /var/www/html. We will put our script in a directory called android and that the uploads folder will be called upload in the android directory.)

The URL you should use in the setup screen will then be something like
http://some_sample_domain.com/android/index.php