文件目录对话框 [英] File Directory Dialog Box

查看:76
本文介绍了文件目录对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Javascript中是否有一种方法可以为打开和

打开对话框,然后还保存文件?

解决方案

文章

< 96 ****************************** @ localhost.talkab outprogramming.com>,
rp*****@nospam.indy.rr.com 用...启发我们

Javascript中是否有一种方法可以显示打开和
然后还保存文件的对话框?



请澄清问题。

正在打开什么文件?

''对话框'是什么意思?提示?一个窗口? 浏览按钮?一个

模态对话窗口?


你是什么意思然后也是?相同的按钮/提示/两者都是什么

任务?两个任务的对话框,但对话框不一样

对象?

-

-

~ kaeli~

食人族不吃小丑是真的吗?因为他们觉得很有趣吗?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


这将是一个文件比较程序。我只需要打开

标准的Windows打开文件对话框,这样用户就可以选择

文件了,我会用两次这样他们可以选择两个文件'这是比较b / b
。比较后,我希望标准窗口保存为框,显示

,以便他们可以保存结果文件。


>我只需要打开

标准窗口打开文件对话框,这样用户就可以选择
文件了,我会用两次这样他们就可以选择这两个文件了
比较。比较之后,我希望标准窗口保存为框
,以便它们可以保存结果文件。




一般情况下,Javascript无法读取或写入文件来自当地

文件系统。


您可以创建一个打开文件系统。通过创建< input type ="文件">对话框形式

元素并且可以通过调用它的onclick方法打开它

(虽然我还没试过)。但我不认为

所选文件的内容可供Javascript使用(同样,我还没有尝试过)。

同样是服务器端实现可以触发另存为和/或

打开方式通过返回浏览器

无法原生处理的类型的内容对话框,但我不相信有一种方法可以生成此类内容。

Javascript生成此类内容。 />

我很想知道是否有人可以建议这样做。


--Phil。


Is there a way in Javascript to bring up dialog boxes for both opening and
then also saving a file?

解决方案

In article
<96******************************@localhost.talkab outprogramming.com>,
rp*****@nospam.indy.rr.com enlightened us with...

Is there a way in Javascript to bring up dialog boxes for both opening and
then also saving a file?



Please clarify the question.
What file is being opened?
What do you mean by ''dialog box''? A prompt? A window? A "browse" button? A
modal dialog window?

What do you mean by "and then also"? Same button/prompt/whatever does both
tasks? A dialog box for both tasks, but the dialog box is not the same
object?
--
--
~kaeli~
Is it true that cannibals don''t eat clowns because they
taste funny?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


This is going to be a file compare program. I just need to have the
standard windows open file dialog box open so the user can select the
file, i will use this twice so they can choose the two file''s to be
compared. After the compare i want the standard windows save as box to
appear so they can save the results file.


> I just need to have the

standard windows open file dialog box open so the user can select the
file, I will use this twice so they can choose the two files to be
compared. After the compare I want the standard windows save as box to appear so they can save the results file.



In general, Javascript cannot read or write files from the local
filesystem.

You can create an "open" dialog by creating an <input type="file"> form
element and could probably open it by invoking its onclick method
(though I haven''t tried it). But I don''t think that the content of the
selected file is available to Javascript (again, I haven''t tried).
Similarly a server-side implementation can trigger a "save as" and/or
"open with" dialog by returning content of a type that the browser
cannot handle natively, but I don''t believe there is a way for
Javascript to generate such content.

I would be curious to know if anyone can suggest a way of doing this.

--Phil.


这篇关于文件目录对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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