使用PAMIE上传和下载文件......有可能吗? [英] Using PAMIE to upload and download files...is it possible?

查看:86
本文介绍了使用PAMIE上传和下载文件......有可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用PAMIE 1.4来尝试自动化网页流程。我不能用它做的一件事就是上传文件和下载文件。


上传文件时,文件输入框不允许PAMIE输入

在文件的路径中。


下载文件后,我可以点击链接下载文件,

但是那就是我被困在哪里。它会显示下载窗口和

然后它会显示保存窗口的位置。


当我遇到这些位置时,我遇到没有错误它只是坐在那里不知道该做什么。


如果有人在上传或下载方面都取得了成功,甚至还有一些

洞察力,我将非常感谢你的帮助。谢谢!

Ive been using PAMIE 1.4 to try to automate web page processes. The one
thing I cannot do with it is upload files and download files.

With uploading files, the file input box does not allow PAMIE to enter
in a path to a file.

With downloading files, I can click on the link to download the file,
but thats where I get stuck at. It brings up that download window and
then it brings up the where to save window.

Theres no errors that I encounter when I get stuck at these spots it
justs sits there not knowing what to do.

If anyone has had success in both uploading or downloading or even some
insight, I would greatly appreciate your help. Thanks!

推荐答案

据我所知,IE的新版本上传和下载

通过脚本禁用作为安全措施。您可能可以执行一些

低级API调用来处理下载窗口。


Roger


" scrimp" < SC ******* @ yahoo.com>在消息新闻中写道:11 ********************* @ g44g2000cwa.googlegro ups.com ...
As I understand it, newer versions of IE have uploading and downloading
via script disabled as a security measure. You might be able to do some
low-level API calls to deal with the download window.

Roger

"scrimp" <sc*******@yahoo.com> wrote in message news:11*********************@g44g2000cwa.googlegro ups.com...
我一直在使用PAMIE 1.4尝试自动化网页流程。我不能做的一件事是上传文件和下载文件。

上传文件时,文件输入框不允许PAMIE进入
的路径文件。

下载文件,我可以点击链接下载文件,
但那就是我被困住的地方。它会显示下载窗口,然后它会显示保存窗口的位置。

当我遇到这些位置时,我遇到没有错误它只是坐在那里不知道该做什么。

如果有人在上传或下载方面取得了成功,甚至还有一些
洞察力,我将非常感谢你的帮助。谢谢!
Ive been using PAMIE 1.4 to try to automate web page processes. The one
thing I cannot do with it is upload files and download files.

With uploading files, the file input box does not allow PAMIE to enter
in a path to a file.

With downloading files, I can click on the link to download the file,
but thats where I get stuck at. It brings up that download window and
then it brings up the where to save window.

Theres no errors that I encounter when I get stuck at these spots it
justs sits there not knowing what to do.

If anyone has had success in both uploading or downloading or even some
insight, I would greatly appreciate your help. Thanks!




---- ==通过Newsfeeds.Com发布 - 无限制 - 未经审查 - 安全Usenet新闻== ----
http://www.newsfeeds.com 世界排名第一的新闻组服务! 120,000多个新闻组

---- =东和西海岸服务器农场 - 通过加密的总隐私= ----



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


你是当你试图这样做时打开文件打开对话框

对吗?

如果是这样你将需要使用winguiauto。要查找对话框并使用

,请输入您想要的信息。


我附上了一些代码,说明了如何执行此操作。另外一个问题就是这些对话框是由ie调用的。 pamie使用

com来控制ie。所以按钮点击后不会返回antell

你已经在对话框中删除了。解决这个问题的最佳方法是

你可以点击按钮来处理对话框。


def useSaveASDialog(filePath = None) :

....."""

.....这个函数设置文件路径,如果它是speesified然后

.....将文件保存到列出的位置,它将返回保存文件的

.....文件路径。

.... 。或者如果文件由于某种原因没有得到保存则没有。

....."""

..... rVal =没有

..... handle = winGuiAuto.findTopWindow(另存为)

..... sButton = winGuiAuto.findControl(句柄,&& ;保存","按钮")

..... sEdit = winGuiAuto.findControl(句柄,无,编辑)

..... if filePath!= None:

......... winGuiAuto.setEditText(sEdit,filePath)

..... rVal = winGuiAuto.getEditText( sEdit)

..... winGuiAuto.clickButton(sButton)

.....返回rVal

def useChooseFileDialog(filePath = None):

....."""

.....这个函数设置文件路径,如果它是spesified然后

.....将文件保存到列出的位置它将返回

.....文件路径保存的文件。

.....如果文件由于某种原因没有保存,则为无。

.....""" ;

..... rVal =无

..... sButton =无

..... handle = winGuiAuto。 findTopWindow(" Choose file")


..... sButton = winGuiAuto.findControls(handle,"& Open"," Button")

..... print sButton

..... sEdit = winGuiAuto.findControl(句柄,无,编辑)

.... .if filePath!=无:

......... winGuiAuto.setEditText(sEdit,filePath)

..... rVal = winGuiAuto.getEditText (sEdit)

..... winGuiAuto.clickButton(sButton [1])

.....返回rVal


希望这个对你有所帮助。


艾琳。

You are opening up the file open dialog when you are trying to do this
right?
If so you will need to use winguiauto. To find the dialog and the use
it to enter the info you want.

I included some code that shows how to do this. One other problem you
are going to have is that these dialogs are called by ie. pamie uses
com to control ie. So the button click will not return antell after
you have delt with the dialog box. Best way to deal with this is to
span a new thred befoe you click the button to deal with the dialog.

def useSaveASDialog(filePath=None):
....."""
.....This function sets the file path if it is spesified then
.....saves the file to the location listed it will return the
.....file path of the saved file.
.....or None if the file didn''t get saved for some reason.
....."""
.....rVal = None
.....handle = winGuiAuto.findTopWindow("save as")
.....sButton = winGuiAuto.findControl(handle,"&Save","Button")
.....sEdit = winGuiAuto.findControl(handle, None, "Edit")
.....if filePath != None:
.........winGuiAuto.setEditText(sEdit, filePath)
.....rVal = winGuiAuto.getEditText(sEdit)
.....winGuiAuto.clickButton(sButton)
.....return rVal
def useChooseFileDialog(filePath=None):
....."""
.....This function sets the file path if it is spesified then
.....saves the file to the location listed it will return the
.....file path of the saved file.
.....or None if the file didn''t get saved for some reason.
....."""
.....rVal = None
.....sButton = None
.....handle = winGuiAuto.findTopWindow("Choose file")

.....sButton = winGuiAuto.findControls(handle,"&Open","Button")
.....print sButton
.....sEdit = winGuiAuto.findControl(handle, None, "Edit")
.....if filePath != None:
.........winGuiAuto.setEditText(sEdit, filePath)
.....rVal = winGuiAuto.getEditText(sEdit)
.....winGuiAuto.clickButton(sButton[1])
.....return rVal

Hope this was of help to you.

Erin.


谢谢。如果我还有其他任何问题,我会尝试提出更多的内容。谢谢

Thank you. I will try to come up with something I will post more if I
have any other questions. Thanks


这篇关于使用PAMIE上传和下载文件......有可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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