从Access 2010上传文件 [英] uploading file from Access 2010

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

问题描述

我有一个Access 2010前端数据库+ MySQL作为后端.到目前为止,一切正常.我想上传文档,并决定保存在服务器上而不是数据库上.我的第一个问题是,如何将文件从访问前端上传到远程服务器/位置?

I have a Access 2010 frontend database + MySQL as backend. So far it is working fine. I would like to upload document and decided to save on the server rather than on the Database. My first question is, how do I upload file from access frontend to the remote server/location?

我当时在想,也许将数据存储在数据库中,并使用某种触发器或脚本从数据库读取blob文件并保存在服务器上,并将文件路径填充到另一列中.

I was thinking, maybe store the data on the database and use some kind of triggers or script which reads the blob file from database and saves on the server as well as fills the file path into another column.

有没有更简单的方法将文件从访问前端上传到远程服务器?我正在使用MySQL服务器作为后端.

is there any easier way to upload files from access frontend to a remote server? I am using MySQL server as backend.

先谢谢您

推荐答案

带腻子的SFTP

这可能会对您有所帮助-这是一个很好的示例,该示例是在Windows计算机上使用Putty通过VFTP通过SFTP与Linux服务器进行通信的方法:

This might help you - it's a great example using Putty on the Windows machine to communicate over SFTP with the Linux server using VBA: SFTP upload with VBA

您需要在使用Access的每台Windows计算机上安装腻子,并确保Linux服务器上具有适当的权限.

You would need to install putty on each Windows machine that uses Access and ensure that the appropriate rights are in place on the Linux server.

自定义加载项

您可以使用.NET创建外接程序,以进行访问以通过套接字将文件传输到服务器,但是这将需要您编写服务器端应用程序以侦听请求.您将完全自由地实现它,而开发人员则为此付出了额外的复杂性.

You could use .NET to create an add-in for access to transfer the file to the server over sockets, but this would require you to write a server-side application to listen for requests. You would have complete freedom over how you implement it at the cost of added complexity for yourself as the developer.

您需要:

  • 使用Visual Studio(或其他.NET IDE)创建加载项
  • 将其添加到Access应用程序中,并使用您构建的API.
  • 创建一个服务器端应用程序以监听它(这可能是一个简单的Python应用程序)

SMTP方法

如果您想发挥创造力,可以使用Access的CDO功能通过电子邮件将文件发送到您自己的模拟SMTP服务器:

If you want to be creative you could email the file to your own mock SMTP server using Access' CDO functionality: Sending emails with Access

同样,您必须创建一个处理程序应用程序来处理SMTP协议,但是我敢肯定那里有一些很棒的例子.

Again, you would have to create a handler application to handle the SMTP protocol, but I'm sure there are some great examples out there.

HTTP方法

您甚至可以对文件进行编码,然后通过HTTP在简单的POST请求中将其发送到简单的PHP服务器:

You could even encode the file and send it over HTTP to a simple PHP server in a simple POST request: Example web request with Access You would need to encode the file to base64 or something or file a way of handling file uploads.

结论

如您所见,到目前为止,最简单的方法是使用Putty,但是您可以采用一些有趣的自定义方法.

As you can see, the easiest approach by far is using Putty, but there are some interesting custom approaches you could take.

我想使用SMTP或HTTP都合适,但这取决于您设置服务器端处理程序的难易程度.可能存在现有的SMTP模拟器,您可以使用它们来处理文件的接收和管理.

I'd say using either SMTP or HTTP would be suitable but that depends how easily you could set up the server-side handler. There may be existing SMTP emulators out there that you could use to handle receiving and managing files.

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

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