I have read the following original post (top of the page: http://www.phpbb.com/phpBB/viewtopic.php?p=648236#648236
I think the original post is what i have been looking for, i am trying to upload standard images to mysql in blob but get:
Warning: open_basedir restriction in effect. File is in wrong directory in /home/torpex/public_html/cgi-bin/upfile.php on line 2
Warning: fopen("/tmp/phpJ6i7eC", "r") - Operation not permitted in /home/torpex/public_html/cgi-bin/upfile.php on line 2
Any Ideas.
Upload Form:
<form method="POST" action="upimg.php?upload=true" enctype="multipart/form-data">
<table align="center" class="formcss">
<tr>
<td>Type</td>
<td> <select name="imgtype">
<option value="image/gif">GIF</option>
<option value="image/jpeg">JPEG</option>
</select> </td>
</tr>
<tr>
<td>File</td>
<td><input type="file" name="imgfile"></td>
</tr>
<tr>
<td> Link
<div align="center"> </div></td>
<td><input type="text" name="imglink" value="<?php echo $strLink ?>"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="hidden" name="imgname" value="<?php echo $strName ?>">
<input type="submit" name="submit" value="Upload">
</div></td>
</tr>
</table>
</form>
include script (in cgi-bin)
<?php
$hndl=fopen("$imgfile","r");
$imgdata=fread($hndl,filesize("$imgfile"));
$imgdata=addslashes($imgdata);
$strSQL = "Update tblimage Set imgtype='$imgtype', imglink='$imglink',imgdata='$imgdata'
Where imgname='$imgname'";
mysql_query($strSQL)
or die("Could not execute query");
fclose($hndl);
?>
How can i manipulate the above original post to work in my case.
Any help greatly appreciated.