[英]How do I upload photos or to ftp / web server from an oracle apex application?
I have an Oracle Apex 5.0 application that is used for data entry, and an ASP.NET MVC5 application that is used for displaying the data.我有一个用于数据输入的 Oracle Apex 5.0 应用程序和一个用于显示数据的 ASP.NET MVC5 应用程序。
Currently, my process is to upload the files manually to the web server through FTP, then store the URLs of the photos and files in a text field in the database.目前,我的流程是通过 FTP 手动将文件上传到 web 服务器,然后将照片和文件的 URL 存储在数据库中的文本字段中。 This process is cumbersome, and requires a lot of copying / pasting.
这个过程很麻烦,需要大量的复制/粘贴。
Ideally, I would like to be able to drag and drop photos onto a region on the web page which uploads the photos to the web server, and stores the URL in the text field.理想情况下,我希望能够将照片拖放到 web 页面上的区域,该页面将照片上传到 web 服务器,并将 ZE6B391A8D2C4D45902A23A8B6585703D 存储在文本字段中。 This process would also create a resized / thumbnail version of the photo that lives alongside the full size image.
此过程还将创建与完整尺寸图像一起存在的照片的调整大小/缩略图版本。
I do not want to store the photos as blobs or attachments inside the database, as they are difficult to work with programatically in other web applications.我不想将照片作为 blob 或附件存储在数据库中,因为它们很难在其他 web 应用程序中以编程方式使用。
APEX would not have a good way to do what you're asking programmatically. APEX 没有很好的方法来以编程方式完成您的要求。 As APEX runs from inside the database and has no default access to the OS, you would have to:
由于 APEX 从数据库内部运行并且对操作系统没有默认访问权限,因此您必须:
Ideally, your web server should not be running on the same host as your database server as this would pose a significant security risk, so right off the bat you are going to have multiple issues.理想情况下,您的 web 服务器不应与数据库服务器在同一主机上运行,因为这会带来重大的安全风险,因此您马上就会遇到多个问题。
A better approach would be a shell script that runs some combination of scp or sftp along with sqlplus to first copy the files securely to the web server and then update the database table with the correct URLs.更好的方法是使用 shell 脚本运行 scp 或 sftp 与 sqlplus 的某种组合,首先将文件安全地复制到 web 服务器,然后使用正确的 URL 更新数据库表。 In most environments this sort of automation would be relatively straight forward to implement.
在大多数环境中,这种自动化的实施相对简单。 It won't have a pretty GUI through a web page, but you'll get better, practical results a lot faster and with a lot less effort.
它不会通过 web 页面获得漂亮的 GUI,但您会更快、更省力地获得更好的实际结果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.