資源描述:
《使aspx頁(yè)面能接受html,asp的頁(yè)面?zhèn)魉偷奈募酚蓵?huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)。
1、使aspx頁(yè)面能接受HTML,asp的頁(yè)面?zhèn)魉偷奈募?>教育資源庫(kù)aspx接受aspx頁(yè)面的文件很簡(jiǎn)單,用HtmlInputFile,就可以了,但是如果接受Html頁(yè)面post的文件就不怎么好辦了,我仿照asp的方法做法如下,自己測(cè)試通過(guò),拿出來(lái)給大家共享,可以限制文件內(nèi)容,類型,大小,自定義存儲(chǔ)位置,在congfig.xml內(nèi)html頁(yè)的內(nèi)容:(來(lái)自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下一頁(yè)>>>>這篇文章來(lái)自..,。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的內(nèi)容:<%上一頁(yè)1234下一頁(yè)>>>>這篇文章來(lái)自..,。PageLanguage="C#"AutoEventsg){StringBuildertext=neber+",""+fileUrl.Replace(""","\"")+"",""+fileName.Replace(""","\"")+"",""+customM