I would to know if it's possible to upload documents (.doc, .zip, .ppt ...and other), in a Mysql Base ? And maybe, you also know what is the fonction to use with PHP ?
You can do this with a mySQL query, but it requres the file to be on the server. If you're trying to get a file from a remote system onto the server, you can first do an HTTP upload to get it on the server, and then use an insert/update statement to get the file into the database. Also, the column that the file is going to go into in the database must be type BLOB.
If you had a table called "mytable" with a two columns called "owner" and "filename", then the query would look something like this:
INSERT into mytable values('me', LOAD_FILE("absolute/path/to_file")
or
UPDATE mytable set filename=LOAD_FILE("absolute/path/to_file" WHERE owner='me';
Ok, thanks for these precise informations. But, if my server is my ISP, is it also possible to do the upload on the server and after the mysql query ?
What is the type, BLOB ?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.