并遇到同样的问题。所以我加入了这行,你会看到下面的,我试图回应这些值。这就是我得到的: 这里是文件名,这里是文件夹 / home / krubner / www / atp / mcImages / 没有文件名。我认为这是问题所在,但为什么还有 突然没有文件名? (我正在运行PHP的4.2.3版本,如果你要求b $ b请求)。 函数uploadImage(){ extract($ config = getConfig()); 全球$表格,$ io,$ users,$ links,$ sql,$ uploadedFile, $ uploadedFile_size,$ uploadedFile_name,$ overRide; $ uploadedFile_name = processFileName($ uploadedFile_name); $ uploadedFile_name = htmlspecialchars($ uploadedFile_name); if($ uploadedFile_size> 10000000&& $ overRide!=" true"){ startPage("此图片非常大,超过10兆字节。你确定 你要继续吗?"); echo" < div class =''dvclMcWholeForm''> < form method =''post''action =''$ self''enctype =''multipart / form-data'' class =''mcForm'' > 上传此图片:< br> < input type =''file''name =''uploadedFile''> < br>< br> < input type =''hidden''name =''choiceMade''value =''uploadImage''> < input type =''hidden''name =''overRide''value =''true''> < input type =''submit''value =''上传文件''> < / form> < / div> " ;; endPage (); } else { $ pathToImageFolder。= $ uploadedFile_name; $ imagesFolder。= $ uploadedFile_name; echo"< br>< br>< br>< br>这里是文件名$ uploadedFile_name和 这里''文件夹$ pathToImageFolder" ;; if(copy($ uploadedFile,$ pathToImageFolder) )) startPage(); echo" < div class =''mcForm''> 图片或文件已上传。如果你想参考它 这是地址:< br>< br> < a href =''$ imagesFolder''> $ imagesFolder < / a> < BR>< BR> 链接代码这个图像看起来像这样:< br>< br> & lt; img src =''$ imagesFolder''& gt; < ; br>< br> 将此代码放在您希望显示此图像的任何页面上: < br>< br> < img src =''$ imagesFolder''> < br>< br> ALT标签控制鼠标时出现的文字光标在图像上悬停 。如果你输入& lt; img src =''myImage.jpg'' ALT =''在夏洛茨维尔市中心拍摄的照片''& gt;然后单词 ''在夏洛茨维尔市中心拍摄的照片'出现了。 < a href =''http://www.htmlhelp.com/reference /wilbur/syntax.html''>You 可以在htmlHelp.com上阅读有关IMG标签语法的更多信息< / a> < br>< br> 另请注意,如果您希望图像浮动在 列的中间,只需将标记& lt; center& gt;在它之前和标签 & lt; / center& gt;在它之后。 (希望所有这些代码编写都将在此软件的未来版本中自动生成;现在, 对不起朋友们,但是你必须亲自编辑这些标签。你想要 它们与下面列出的不同。) < / div> " ;; endPage(); } else { 全球$表单,$ io,$ users,$ links,$ sql,$ users; startPage(); echo" < div class =''mcForm''> 由于某种原因,上传失败。这个问题可能是暂时的 或永久性问题。再试一次。 < / div> " ;; endPage(); } } } 函数printFormForImageUpload(){ extract ($ config = getConfig()); //我们需要打印表格 startPage("注意:某些图像类型不能在网络上运行上传 图片有''jpe''或'jpg''或''jpeg''或''gif''或''png''作为他们的 endings。"); echo" < div class =''dvclMcWholeForm''> < form method =''post''action =''$ self''enctype =''multipart / form-data'' class =''mcForm''> 上传此图片:< br> < input type =''file''name =''uploadedFile''>< br>< br> < input type =''hidden''name =''choiceMade''value =''uploadImage''> &l t;输入类型='''提交''价值=''上传文件''> < / div> " ;; endPage(); }I''ve been using the following function (yes, it is inelegant, what canI say, I wrote it a long time ago) to upload images. Haven''t had aproblem with it for at least a year, and I don''t recall changing itanytime recently. Nevertheless, the script is suddenly dying on thisline:if (copy($uploadedFile, $pathToImageFolder)){This is the error I get:Warning: Unable to access in/home/www/krubner/atp/mcIncludes/mcImages.php on line 199My first thought was to check permissions - they were set to 755, butto test if they were the problem I changed them to 777. Tried againand got the same problem. So then I added in the line, you''ll see itbelow, where I try to echo out the values. This is what I get:here''s the file name and here''s the folder/home/krubner/www/atp/mcImages/There is no file name. I assume that is the problem, but why is theresuddenly no file name? (I''m running version 4.2.3 of PHP, if you''reasking).function uploadImage() {extract($config = getConfig());global $forms, $io, $users, $links, $sql, $uploadedFile,$uploadedFile_size, $uploadedFile_name, $overRide;$uploadedFile_name = processFileName($uploadedFile_name);$uploadedFile_name = htmlspecialchars($uploadedFile_name);if ($uploadedFile_size > 10000000 && $overRide != "true") {startPage("This image is very large, over 10 megabyte. Are you sureyou want to proceed?");echo "<div class=''dvclMcWholeForm''><form method=''post'' action=''$self'' enctype=''multipart/form-data''class=''mcForm''>Upload this image: <br><input type=''file'' name=''uploadedFile''><br><br><input type=''hidden'' name=''choiceMade'' value=''uploadImage''><input type=''hidden'' name=''overRide'' value=''true''><input type=''submit'' value=''Upload File''></form></div>";endPage();} else {$pathToImageFolder .= $uploadedFile_name;$imagesFolder .= $uploadedFile_name;echo "<br><br><br><br> here''s the file name $uploadedFile_name andhere''s the folder $pathToImageFolder ";if (copy($uploadedFile, $pathToImageFolder)) {startPage();echo "<div class=''mcForm''>The image or file has been uploaded. If you wish to reference itthis is the address:<br><br><a href=''$imagesFolder''>$imagesFolder</a><BR><BR>The code for a link to this image would look like this:<br><br><img src=''$imagesFolder''><br><br>Put this code on any page where you want this image to appear:<br><br><img src=''$imagesFolder''><br><br>The ALT tag controls what text appears when the mouse cursor hoversover an image. If you type <img src=''myImage.jpg''ALT=''Photo taken in downtown Charlottesville''> then the words''Photo taken in downtown Charlottesville'' are what appear.<a href=''http://www.htmlhelp.com/reference/wilbur/syntax.html''>Youcan read more about IMG tag syntax on htmlHelp.com</a><br><br>Also note that if you want an image to float in the middle of acolumn, just put the tag <center> before it and the tag</center> after it. (Hopefully all this code writing will beautomated in future versions of this software; for now,sorry folks, but you''ve got to hand edit these tags if you wantthem any different than how they are listed below.)</div>";endPage();} else {global $forms, $io, $users, $links, $sql, $users;startPage();echo "<div class=''mcForm''>For some reason the upload failed. This problem might be temporaryor permanent. Try again.</div>";endPage();}}}function printFormForImageUpload() {extract($config = getConfig());// We need to print the formstartPage("Note: certain image types don''t work on the web. Uploadimages that have ''jpe'' or ''jpg'' or ''jpeg'' or ''gif'' or ''png'' as theirendings.");echo "<div class=''dvclMcWholeForm''><form method=''post'' action=''$self'' enctype=''multipart/form-data''class=''mcForm''>Upload this image: <br><input type=''file'' name=''uploadedFile''><br><br><input type=''hidden'' name=''choiceMade'' value=''uploadImage''><input type=''submit'' value=''Upload File''></div>";endPage();}推荐答案 uploadedFile,uploadedFile, pathToImageFolder)){ 这是我得到的错误: 警告:无法访问 / home / www / krubner / atp / mcIncludes / mcImages.php在第199行 我的第一个想法是检查权限 - 它们被设置为755,但是 来测试它们是否是问题是我把它们改成了777.再试一次 并得到了同样的问题。所以我加入了这行,你会看到下面的,我试图回应这些值。这就是我得到的: 这里是文件名,这里是文件夹 / home / krubner / www / atp / mcImages / 没有文件名。我认为这是问题所在,但为什么还有 突然没有文件名? (我正在运行PHP的4.2.3版本,如果你要求b $ b请求)。 函数uploadImage(){ extract(pathToImageFolder)){This is the error I get:Warning: Unable to access in/home/www/krubner/atp/mcIncludes/mcImages.php on line 199My first thought was to check permissions - they were set to 755, butto test if they were the problem I changed them to 777. Tried againand got the same problem. So then I added in the line, you''ll see itbelow, where I try to echo out the values. This is what I get:here''s the file name and here''s the folder/home/krubner/www/atp/mcImages/There is no file name. I assume that is the problem, but why is theresuddenly no file name? (I''m running version 4.2.3 of PHP, if you''reasking).function uploadImage() {extract( config = getConfig()); globalconfig = getConfig());global 这篇关于chmod到777但仍然获得图片上传权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!