如何使用javascript在输入类型文件中设置默认值? [英] How to set default value in input type file by using javascript?

查看:96
本文介绍了如何使用javascript在输入类型文件中设置默认值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想将文件从本地系统上传到服务器时。那时我想在输入类型文件字段中设置本地路径,但是它没有设置为该值。所以我无法上传文件。

When I want to upload file from local system to server. At that time I want to set local path in input type file field but it is not set to that value. So I'm unable to upload file.

所以请帮帮我。

代码:

<input type="file" name="fileName" id="fileId" value="c:\\\\myFolder\\myFile.txt">


推荐答案

出于安全原因,浏览器不允许,上传输入是readonly,除非你有定制的uplod输入

For securinty reasons browsers do not allow, upload inputs are readonly , unless you have have custom made uplod input

这篇关于如何使用javascript在输入类型文件中设置默认值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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