if (!IsPostBack) { if (Application["RaNum"] == null) { Random ra = new Random(); Application["RaNum"] = ra; } } if (pictureUP.HasFile) { //Response.Write(FileUpload1.PostedFile.ContentLength); if (pictureUP.PostedFile.ContentLength <…
项目中,常常需要用到文件的上传和下载,上传和下载功能实际上是对Document对象进行insert和查询操作.本篇演示简单的文件上传和下载,理论上文件上传后应该将ID作为操作表的字段存储,这里只演示文件上传到Document对象中. 一.文件上传功能 apex代码 public with sharing class FileUploadUsedTransientController { public transient Blob fileUploadBody{get;set;} public S…