【发布时间】:2013-09-28 04:13:44
【问题描述】:
所以我有一个非常简单的文件上传表单,代码如下...
<form enctype="multipart/form-data" action="$theaction" method="POST">
<input name="source" type="file">
<input name="message" type="text" value="">
<input type="submit" value="Upload"/>
</form>
我想知道我是否可以用php设置文件上传的来源?有点像..
<?php $file = "http://mywebsite.com/path/to/img.jpg"; ?>
<input name="source" type="file" src="<?php echo $file; ?>">
我已经用谷歌搜索了它,但我什么也想不出来。我觉得我只是没有使用正确的词汇,但任何帮助将不胜感激!
【问题讨论】:
-
在没有用户交互的情况下实际选择文件的能力将是一个相当大的安全漏洞。如果您只想提供“提示”,那么已经有 a question about that here,尽管缺乏答案表明这也是不可能的。