English 中文(简体)
文件名中的空格不链接失败
原标题:unlink fails with space in filename
  • 时间:2012-05-24 19:49:17
  •  标签:
  • php
  • html

我试图解开已勾选复选框的文件的链接, 但文件名有“ 无标题文档” 这样的空格( 读取到无标题), 我正获取这个错误 :

Warning: unlink(../pdf_files/Untitled) [function.unlink]: No such file
or directory in C:xampphtdocs

我正通过价值观使用:

<input type="checkbox" name="file[]" value =   . $num .   /> ;

数组 file[] 似乎存储了包含空格的文件名的第一个单词。 我如何才能解决这个问题?

最佳回答

您需要将 value 属性以引号包装。 否则它会像这样显示 :

<input type="checkbox" name="file[]" value=Untitled Document />

因此浏览器只能将 Unitited 视为 value , 然后再将一个无效的错误 Document 属性视为 。 请尝试 :

echo  <input type="checkbox" name="file[]" value="  . $num .  " /> ;
问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签