Ok, I have written a image upload script, and had it running perfectly under my testing enviroment (win32 apache, win2k). I moved it to my host (IIS5, win2k), and the script now generates errors.
errors:
Warning: Unable to create 'images/user/doa3icon.gif': No such file or directory in D:\web\Inetpub\windrivers\image.php on line 10
Warning: getimagesize: Unable to open 'images/user/doa3icon.gif' for reading. in D:\web\Inetpub\windrivers\image.php on line 14
script:
<?php
include('header.inc');
if($action == "upload" AND $level <= 3 AND $level != 0){
$title = "Upload Image";
include('top.inc');
if($submit AND $level <= 3 AND $level != 0){
if ($upload_type != "application/octet-stream") {
$filepath = "images/user/"."$upload_name";
copy($upload, $filepath);
$result=MYSQL_QUERY("INSERT INTO image (nick,filepath,filename,filesize,filetype) ".
"VALUES ('$auth[0]','$filepath','$upload_name','$upload_size','$upload_type')");
$fileid = mysql_insert_id();
$size = GetImageSize($filepath);
$result = mysql_query("update image set width='$size[0]', height='$size[1]' where id='$fileid'");
?>
<p align="center">UPLOADED SUCCESSFUL</p>
<p align="center"><img src="<? echo $filepath ?>"></p>
<p align="center"><b>Image address:</b> http://festy.ath.cx/<? echo $filepath ?><br>
<b>Use this code to link:</b> <font face="courier"><img src="http://festy.ath.cx/<? echo $filepath ?>"></font></p>
<?
}else{
?><center>YOU DIDNT SPECIFY A FILE</center><?
};
}else{
?>
<form name="uploadimage" method="post" action="image.php?action=upload" enctype="multipart/form-data">
<center>
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td align="center">
<font size="5">Upload Image</font><br>
</td>
<tr>
<tr>
<td>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
Browse for Image:
</td>
<td>
<input type="file" name="upload" size="80">
</td>
</tr>
</table>
</td>
<tr>
<tr>
<td align="center">
<br><input type="submit" name="submit" value="Submit">
</td>
<tr>
</table>
</center>
</form>
<?
};
};
I hope someone has an idea 🙂
Thanks,
Sam.