tags:

views:

48

answers:

2

Help!!! i want to upload a file from database(or from local m/c) to server in php without user interface. Is it possible. Please Suggest.

+1  A: 

Since you mention Ajax I assume you mean you want to upload it using JavaScript running in a web browser (and the server side component happens to use PHP).

This is impossible in the normal browser security context.

Users must explicitly select files to upload (otherwise webpages could go around stealing all sorts of private files behind users backs).

Users cannot do this without a user interface.

David Dorward
A: 

You could try curl from the command line:

curl --upload-file your.file.txt http://example.com/upload.php
Darin Dimitrov
@Darin can u tell me this in brief,please
Martin
You download and install `curl` from the address I provided and issue the previous command from the command prompt. It will POST the specified file to the given web address which could insert it into a database.
Darin Dimitrov