Android / PHP-在Web服务器上发送txt文件?

Are there any tutorials showing example code for sending text files across a Server?

I am currently uploading data from an SQLite database in my native Android application to a MYSQL database using PHP script on 00WebHost. But i also need to upload Text files, just into a folder on the server.

How can I do so?

Well, if it's just text files, you might be better off having your android app read them into a string, sending that to the PHP script, and then having the PHP script writing the file out. Then you're just posting text, which is probably not too different from what you're doing to transfer SQL data.

Dealing with actual files is not super hard, but it does add a couple extra steps. Here's a decent beginner tutorial for handling file uploads in PHP:

http://www.tizag.com/phpT/fileupload.php

(Please note that this tutorial clearly states the resultant code is inherently insecure. I expect this project is a prototype or a learning exercise, so that's probably fine, but make sure you lock this down if the project ever gets used in production!)

Now, this tutorial, and probably any you find will operate under the assumption you are uploading the file from a web page, rather than from an app, because that is the much more typical use case for a web application.

I don't know Android programming at all, but I would expect there is a way to mimic this form, uploading to the same PHP script the same way.

I expect you are submitting the SQL data to PHP using an HTTP POST request. You would probably use a similar technique to upload the file, but the content-type header would be "multipart/form-data" instead of whatever you are using now.

For further background, here's the PHP docs on file uploads: http://php.net/manual/en/features.file-upload.post-method.php

And here's the section on reading and writing files: http://php.net/manual/en/book.filesystem.php

The more I think about this, the Android portion of this question may be critical, and I don't know how to do that part. But I'll post this, and hopefully it will help. And maybe you already know how to do the Android part and/or someone will come along and have a better answer there.