Hi There,
I have been reading a tutorial on a website that shows people how to upload files into a MYSQL server - which seems to work perfectly.
** Code Extract **
if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0)
{
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];
$fp = fopen($tmpName, 'r');
$content = fread($fp, filesize($tmpName));
$content = addslashes($content);
fclose($fp);
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
}
However, the problem I am faced with is that I would like to use MSSQL as the server to upload to, and I understand that the ADDSLASHES command will not work with MSSQL? I have tried using a combination of ADDSLASHES and str_replace commands, to escape the single quotes - but to no avail I am afraid.
Can anyone help by helping me to modify the code above to allow me to upload to my MSSQL DB?
Thanks in advance
Matt