为什么文件上传不起作用? [英] why file upload cannot work?

查看:73
本文介绍了为什么文件上传不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望文件上传元素消失,而不是它,我放置一个文本

框和一个带有我自己的CSS定义的按钮。

但它没有''在IE7上工作。我现在该怎么办?

< form action =" upload.php"方法= QUOT; POST" enctype =" multipart / form-data">

< p>

< span>选择照片:< / span>

< input type =" file"命名= QUOT;相片" style =" display:none;">

< input type =" text"名称= QUOT; photoUrl"类= QUOT; S1" />

< input type =" button" class =" s2"

onClick =" photo.disabled = false; photo.click(); photoU rl.value = photo.value; photo.disabled = true"

value ="浏览" />

< / p>

< / form>

I want the file upload element disappear, instead of it, I place a text
box and a button with my own css defination.
but it doesn''t work on IE7. What should I do now?
<form action="upload.php" method="POST" enctype="multipart/form-data">
<p>
<span>Select photo:</span>
<input type="file" name="photo" style="display:none;">
<input type="text" name="photoUrl" class="s1" />
<input type="button" class="s2"
onClick="photo.disabled=false;photo.click();photoU rl.value=photo.value;photo.disabled=true"
value="Browse" />
</p>
</form>

推荐答案

6月10日晚11点31分,广西&xvt ... @ gmail.com写道:
On Jun 10, 11:31 pm, GuangXiN <xvt...@gmail.comwrote:

我希望文件上传元素消失,而不是它,我放置一个文本

框和一个带有我自己的CSS定义的按钮。

但是它不适用于IE7。我现在该怎么办?

< form action =" upload.php"方法= QUOT; POST" enctype =" multipart / form-data">

< p>

< span>选择照片:< / span>

< input type =" file"命名= QUOT;相片" style =" display:none;">

< input type =" text"名称= QUOT; photoUrl"类= QUOT; S1" />

< input type =" button" class =" s2"

onClick =" photo.disabled = false; photo.click(); photoU rl.value = photo.value; photo.disabled = true"

value ="浏览" />

< / p>

< / form>
I want the file upload element disappear, instead of it, I place a text
box and a button with my own css defination.
but it doesn''t work on IE7. What should I do now?
<form action="upload.php" method="POST" enctype="multipart/form-data">
<p>
<span>Select photo:</span>
<input type="file" name="photo" style="display:none;">
<input type="text" name="photoUrl" class="s1" />
<input type="button" class="s2"
onClick="photo.disabled=false;photo.click();photoU rl.value=photo.value;photo.disabled=true"
value="Browse" />
</p>
</form>



将按钮变成一个锚,你可以按照你想要的任何方式设置样式。

turn the button into a anchor you can style that any way you want.


Lu ******* @ gmail.com 写道:

6月10日晚上11点31分,广西&xvt ... @ gmail.com写道:
On Jun 10, 11:31 pm, GuangXiN <xvt...@gmail.comwrote:

>我希望文件上传元素消失,而不是它,我放置了一个文本
框和一个带有我自己的CSS定义的按钮。
但它不适用于IE7。我现在该怎么办?
< form action =" upload.php"方法= QUOT; POST" enctype =" multipart / form-data">
< p>
< span>选择照片:< / span>
< input type =" file"命名= QUOT;相片" style =" display:none;">
< input type =" text"名称= QUOT; photoUrl"类= QUOT; S1" />
< input type =" button" class =" s2"
onClick =" photo.disabled = false; photo.click(); photo Url.value = photo.value; photo.disabled = true"
value =" Browse" ; />
< / p>
< / form>
>I want the file upload element disappear, instead of it, I place a text
box and a button with my own css defination.
but it doesn''t work on IE7. What should I do now?
<form action="upload.php" method="POST" enctype="multipart/form-data">
<p>
<span>Select photo:</span>
<input type="file" name="photo" style="display:none;">
<input type="text" name="photoUrl" class="s1" />
<input type="button" class="s2"
onClick="photo.disabled=false;photo.click();photo Url.value=photo.value;photo.disabled=true"
value="Browse" />
</p>
</form>



将按钮变成一个锚,你可以按照你想要的任何方式设置样式。


turn the button into a anchor you can style that any way you want.



对不起,我的意思是文件上传元素不起作用。

文件上传元素'的风格不能设置,所以我让它看不见,

但是它不能向网络服务器发送正确的文件上传请求。

Sorry, what I mean is the file upload element doesn''t work.
the file upload element''s style cannot be set, so I make it unvisiable,
but so it can''t send a correct file upload request to web server.


GuangXiN写道2008年6月11日在comp.lang.javascript
GuangXiN wrote on 11 jun 2008 in comp.lang.javascript:
Lu ******* @ gmail.com 写道:

> 6月10日晚上11点31分,广西< xvt ... @ gmail.comwrote:
>On Jun 10, 11:31 pm, GuangXiN <xvt...@gmail.comwrote:

>>我希望文件上传元素消失,而不是它,我放置一个
文本框,一个带有我自己的CSS定义的按钮。
但它不适用于IE7。我现在该怎么办?
< form action =" upload.php" method =" POST"
enctype =" multipart / form-data">
< p>
< span>选择照片:< / span>
< input type =" file"命名= QUOT;相片" style =" display:none;">
< input type =" text"名称= QUOT; photoUrl"类= QUOT; S1" />
< input type =" button" class =" s2"
onClick =" photo.disabled = false; photo.click(); phot oUrl.value = photo.valu
e; photo.disabled = true"值= QUOT;浏览” />
< / p>
< / form>
>>I want the file upload element disappear, instead of it, I place a
text box and a button with my own css defination.
but it doesn''t work on IE7. What should I do now?
<form action="upload.php" method="POST"
enctype="multipart/form-data">
<p>
<span>Select photo:</span>
<input type="file" name="photo" style="display:none;">
<input type="text" name="photoUrl" class="s1" />
<input type="button" class="s2"
onClick="photo.disabled=false;photo.click();phot oUrl.value=photo.valu
e;photo.disabled=true" value="Browse" />
</p>
</form>


将按钮变成一个锚点,您可以按照自己想要的方式设置样式。


turn the button into a anchor you can style that any way you want.



对不起,我的意思是文件上传元素不起作用。

文件上传元素'的风格不能是设置,所以我把它设为

不可见,但所以它不能向web发送正确的文件上传请求

服务器。


Sorry, what I mean is the file upload element doesn''t work.
the file upload element''s style cannot be set, so I make it
unvisiable, but so it can''t send a correct file upload request to web
server.



不工作在这个NG中不是一个可接受的fraze,除非你解释

什么和怎么做,调试是做什么的,以及你遇到的错误字符串和

亚麻布。


作为安全措施,您无法操纵html

上传表单的输入文件元素。否则,秘密上传另一个

文件比显示的文件太容易了,因此会损害用户的私密部分。


-

Evertjan。

荷兰。

(请将x''es更改为我的电子邮件地址中的点数)

"Doesn''t work" is not an acceptable fraze in this NG, unless you explain
what and how, what debugging tou did, and if and what errorstring and
linenumbers you encountered.

As a security measure, you cannot manipulate the input file element of html
upload forms. Otherwise it would be too easy to secretly upload another
file than the one shown and so compromize the user''s private parts.

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


这篇关于为什么文件上传不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆