How Do I Upload Files to the database with SAFileUp? Don't do it! Use SAFileUp to upload the files to the server but do not store the image in the database. Instead store the path to the file. Better yet if the images will sit in the same folder just store the actual file name. Uploading the entire image to the database wastes too many resources. You need to...[ 查看全文 ]
一般的表单都是通过ajax方式提交,所以碰到带文件上传的表单就比较麻烦。基本原理就是在页面增加一个隐藏iframe,然后通过ajax提交除文件之外的表单数据,在表单数据提交成功之后的回调函数中,通过form单独提交文件,而这个提交文件的form的target就指向前述隐藏的iframe。 html 代码 代码如下: html body form action="upload.jsp" id="form1" name="form1"encType="multipart/form-data" method...[ 查看全文 ]
多文件上传的例子//upload_html.php--------------------------------------------------------------------------------------------- HTML HEAD TITLE上传文件/TITLE /HEAD script function beforesubmit(forma) { var indexnamea=forma.indexname.value; var upfilea=forma.upfile.value; var k=/ /g; var indexnamea=indexnamea.repla...[ 查看全文 ]