你是指目标路径吗?我改了以后还是报错啊
move_uploaded_file(D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pro_img\1201675640705.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Chirand\data\mysql-function.php on line 241
move_uploaded_file(D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pro_img\1201675640705.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Chirand\data\mysql-function.php on line 241
解决方案 »
- 关于PHP的_set()和_get()
- 我把 5.2.17 里的 php_zip.dll 移到 php.5.3.5, 重启APACHE 提示下面错误怎么办?
- curl问题,在线
- Php和mssql 交互
- apache2.4.4+php5.4.15时不时挂掉
- 麻烦大家推荐几个比较好的PHP的博客,OA,网上交易系统
- $im=@imagecreatefromjpeg($file)这行代码执行为何错误?
- 急!!!!php连mysql数据库老是连不上。求助!
- 替换字符串函数的问题?我要把"asd3/4sdwe/wqedasd/"中的‘/’去掉,变成空格,怎么做?
- 讨论php中有那些错误是可以屏蔽不显示出来的?
- 如何用javascript关闭指定页面
- 只用SQL语句如何取前5天的记录?
是你网站的根路径开始,拼好个路径.
然后就ok了..
private string GetUploadFile(string pubId, string positionId)
{
string uploadFilePath = "";
if (filuplImg.HasFile)
{
string fileName = filuplImg.FileName.ToLower().Trim();
int l = fileName.Length;
if (fileName.Substring(l - 4, 4) == ".jpg" || fileName.Substring(l - 4, 4) == ".gif" || fileName.Substring(l - 4, 4) == ".swf")
{
if (filuplImg.FileContent.Length < (1024 * 100))
{
try
{
string directoryName = ConfigurationManager.AppSettings["WebpubPhysicalPath"].ToString() + @"\AD\Conent\" + pubId + @"\";
if (!Directory.Exists(directoryName))
{
Directory.CreateDirectory(directoryName);
}
string uploadFile = directoryName + positionId + fileName.Substring(l - 4, 4);
filuplImg.SaveAs(uploadFile);
uploadFilePath = @"AD/Conent/" + pubId + @"/" + positionId + fileName.Substring(l - 4, 4);
}
catch (Exception ex)
{
lblValidation.Text += "<div>·上传图片时出错(" + ex.Message + ")</div>";
}
}
else
{
lblValidation.Text += "<div>·上传图片请小于100K </div>";
}
}
else
{
lblValidation.Text += "<div>·只能上传.jpg、.gif图片或.swf文件 </div>";
}
}
return uploadFilePath;
}
是得到根的话.后面拼字符路径的时候怎么会是. "/pro_img/"; ?????
总得一句话.你要上传,就必须把目标路径写正确.
你现在的问题就是把你的目标路径跟出来.