使用form上传文件到application server的另一种办法

简介: 使用form上传文件到application server的另一种办法

Created by Jerry Wang, last modified on Sep 23, 2014

界面如下: 使用fileupload控件选择local file后,点击Stash the file上传:

image.png

在ABAP端接收到的http request header里包含的form fields如下:

image.png

在ABAP端接收到的完整http request download到本地如下:

image.png


source code如下:


Your email address:


Custom file label:


File to stash:

Stash the file!

</div><div>function sendForm() {</div><div> var oOutput = document.getElementById("output");</div><div> var oData = new FormData(document.forms.namedItem("fileinfo"));</div><div><br /></div><div> oData.append("CustomField", "This is some extra data");</div><div><br /></div><div> var oReq = new XMLHttpRequest();</div><div> oReq.open("POST", "https://ag3:44354/sap/crm/file_upload", true);</div><div> oReq.onload = function(oEvent) {</div><div>   if (oReq.status == 200) {</div><div>     oOutput.innerHTML = "Uploaded!";</div><div>   } else {</div><div>     oOutput.innerHTML = "Error " + oReq.status + " occurred uploading your file.<br \/>";</div><div>   }</div><div> };</div><div><br /></div><div> oReq.send(oData);</div><div>}</div><div>


相关文章
|
Linux iOS开发 MacOS
IIS10 部署网站报【HTTP 错误 500.19 - Internal Server Error】的解决办法
原有的 web 发布文件是可以正常部署 IIS10 上面运行的,由于本地电脑环境迁移,重新换了一个宿主机部署 IIS10,网站运行提示如下信息:HTTP 错误 `500.19 - Internal Server Error` 无法访问请求的页面,因为该页的相关配置数据无效。详细错误信息:模块 `IIS Web Core` 通知 `未知 处理程序 尚未确定 错误...
1509 0
IIS10 部署网站报【HTTP 错误 500.19 - Internal Server Error】的解决办法
jira项目笔记8-json-server模拟数据
jira项目笔记8-json-server模拟数据
70 0
jira项目笔记8-json-server模拟数据
Upload Picture to application server
Upload Picture to application server
Upload Picture to application server
|
Android开发
|
PHP
iis 访问HTTP 错误 500.0 - Internal Server Error无法在<fastCGI>应用程序配置中找到<handler> scriptProcessor
iis 访问HTTP 错误 500.0 - Internal Server Error无法在应用程序配置中找到 scriptProcessor
11795 0
|
.NET Windows 开发框架
Server Error in '/虚拟目录名称' application②
Server Error in '/虚拟目录名称' application 提示:Unable to make the session state request to the session state server.
1003 0