欢迎来到天天文库
浏览记录
ID:20531985
大小:59.50 KB
页数:4页
时间:2018-10-12
《使aspx页面能接受html,asp的页面传送的文件》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、使aspx页面能接受HTML,asp的页面传送的文件>>教育资源库aspx接受aspx页面的文件很简单,用HtmlInputFile,就可以了,但是如果接受Html页面post的文件就不怎么好办了,我仿照asp的方法做法如下,自己测试通过,拿出来给大家共享,可以限制文件内容,类型,大小,自定义存储位置,在congfig.xml内html页的内容:(来自FCKeditor)<html><head><title>FCKeditor-UploadersTests<
2、/title><scriptlanguage="javascript">functionSendFile(){varsUploaderUrl=cmbUploaderUrl.value;if(sUploaderUrl.length==0)sUploaderUrl=txtCustomUrl.value;if(sUploaderUrl.length==0){alert('PleaseprovideyourcustomURLorselectadefaultone');return;}eUR
3、L.innerHTML=sUploaderUrl;txtUrl.value='';frmUpload.action=sUploaderUrl;frmUpload.submit();}functionOnUploadpleted(errorNumber,fileUrl,fileName,customMsg){sber){case0://NoerrorstxtUrl.value=fileUrl;alert('Fileuploadederroralert(customMsg);break;case10:/
4、/CustomMsg);break;case201:txtUrl.value=fileUrl;alert('Afileenameisalreadyavailable.Theuploadedfilehasbeenrenamedto"'+fileName+'"');break;case202:alert('Invalidfile');break;case203:alert("Securityerror.Youprobablydon'thaveenoughpermissionstoupload.Pleas
5、echeckyourserver.");break;default:alert('Erroronfileupload.Errornumber:'+errorNumber);break;}}</script></head><body><tablecellSpacing="0"cellPadding="0"bUploaderUrl"name="Select1"><optionselectedvalue="asp/upload.asp">ASP&
6、lt;/option>&nbs1234下一页>>>>这篇文章来自..,。p;<optionvalue="php/upload.php">PHP</option><optionvalue="Upload.aspx?type=image">aspx</option></select></td><tdnop;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;</td><tdUploaderURL
7、:<BR><inputid="txtCustomUrl"style="Upload"target="Upload-data"action=""method="post">Uploadanee="Ne></td><tdstyle="p;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;</td><tdvAlign="top"p;nbsp;</span></td></tr><tr>
8、<tdheight="100%"><iframename="Uploadl>upload.aspx的内容:<%上一页1234下一页>>>>这篇文章来自..,。PageLanguage="C#"AutoEventsg){StringBuildertext=neber+",""+fileUrl.Replace(""","\"")+"",""+fileName.Replace(""","\"")+"",""+customM
此文档下载收益归作者所有