0
向我的網站添加新項目時,我搜索要上傳到我的網站的項目圖片。找到該文件並完成表單後,我單擊添加。這應該把我的本地圖片,並將其存儲到我的圖像/租賃目錄。此外,圖片將自動按照項目編號命名,並將拇指添加到文件名(例如:109_thumb.jpg)。將圖像上傳到網站並重命名
以下是我在更改目錄後嘗試過的代碼,但無法使其再次運行。
<tr>
<td align="right" class="tdTextBold">Thumb Image:
</td>
<td><font class="errMsgB">*</font></td>
<td align="left">
<input id="fiuImage1" type="file" name="fileRentalThumbImage" /><div class="VCenter100" id="preview3" align="center"><? if ($rentalThumbImage!="" && $rentalThumbImage!=null)?><img src="../<? echo $rentalThumbImage; ?>" width="80" height="100" /></div>
<!--<div class="column">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<?
if ($rentalThumbImage!="" && $rentalThumbImage!=null)
{
?>
<div class="VCenter100" id="preview1" align="center"><? if ($rentalThumbImage!="" && $rentalThumbImage!=null)?><img src="../<? echo $rentalThumbImage; ?>" /></div>
<?
}
else
{
?>
<div class="VCenter100" id="preview1" align="center">Thumb Image</div>
<?
}
?>
</td>
<td> </td>
<td>
<div class="column">
<div class="file_button">
<input id="uploadButton" style="WIDTH: 120px" type="button" value="Browse" name="file1" /> <input class="hiddenMask" id="fiuImage1" type="file" onchange="prePicture(this.name,'preview1')" name="fileRentalThumbImage" />
</div>
<input style="WIDTH: 100px" onclick="document.frmMovie.rentalThumbImage.value='';removeImage('fiuImage1','preview1'); get('haveImage1').value='N';" type="button" value="Delete" name="remoteImage1"/>
</div>
<div style="CLEAR: both">
</div> </td>
<td> </td>
</tr>
</table>
</div>
請參閱http://php.net/manual/en/reserved.variables.files.php –