简体   繁体   English

如何从 oracle 顶点应用程序上传照片或上传到 ftp / web 服务器?

[英]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 从数据库内部运行并且对操作系统没有默认访问权限,因此您必须:

  1. Somehow grant the Oracle DB access to the web server file directories以某种方式授予 Oracle DB 访问 web 服务器文件目录
  2. Store the files as BLOBs将文件存储为 BLOB
  3. Figure out how to decode and write the files to the an OS directory using a PL/SQL stored procedure弄清楚如何使用 PL/SQL 存储过程解码文件并将其写入操作系统目录
  4. Delete the BLOBs删除 BLOB

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.

相关问题 如何允许多个连接同时上传和下载到 FTP 服务器或在 nodejs 中同步连接? - How do I allow multiple connections to Upload and Downlod to and from a FTP server at the same time or make the connections synchronously in nodejs? 如何使用 javascript 在 FTP 服务器中上传文件? - How can I upload a file in an FTP server using javascript? 我如何使用此代码在apex中从oracle连接我的数据库 - how to i connect my databse from oracle using this code in apex 将本地文件从Webbrowser直接上传到FTP服务器,绕过Web服务器 - Upload local file from webbrowser directly to FTP server, bypass the web server 如何从多选 lov 中检索所选项目并将它们与预定列表进行比较,作为 oracle apex 18.2 中的动态操作? - How do I retrieve selected items from a multi-select lov and compare them to a predetermined list as a dynamic action in oracle apex 18.2? 如何从我的网站/ Web应用程序连接到安全的FtP? - How to connect to a secure FtP from my website/web application? Ajax将文件从浏览器上传到FTP服务器 - Ajax upload a file from browser to FTP server 如何通过 HTML 格式的服务器上的网页将文件上传到我的 Web 服务器? - How do I Upload Files to my Web Server Through a Webpage on the Server in HTML? 如何使用vanilla javascript通过ajax将多张照片上传到Laravel应用程序? - How can I upload multiple photos to a Laravel application through ajax using vanilla javascript? 如何使用javascript将文件上传到FTP服务器? - How to upload a file to FTP server with javascript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM