Edit Image Upload

Source: Internet
Author: User

In FileDialog.aspx.cs

       if((CanEdit) && (BrowserType! ="folder"))            {                stringFilesystemtoken =Global.FileSystemToken.ToString (); Uploader. Usedropzone=Webconfigsettings.filedialogenabledragdrop; Uploader. Uploadbuttonclientid=Btnupload.clientid; Uploader. Serviceurl=Navigationroot+"/services/fileservice.ashx?cmd=uploadfromeditor&q="+Server.URLEncode (Hdnfolder.clientid)+"&t="+Filesystemtoken; //assign the return value to the Txtselection control and the Hdnfileurl control, and then simulate the Click btnsubmit button//return value TxtselctionUploader. Returnvalueformfieldclientid =Txtselection.clientid; //return value HdnfileurlUploader. RETURNVALUEFORMFIELDCLIENTID2 =Hdnfileurl.clientid; //return value BtnsubmitUploader. RETURNVALUEFORMFIELDCLIENTID3 = Btnsubmit.clientid;

In JqueryFileUpload.cs

     //Set the return value from the upload as the value on the provided input ID//set the return value--txtselection            if(Returnvalueformfieldclientid.length >0) {script. Append ("var input = $ (' #"+ Returnvalueformfieldclientid +"'); "); Script. Append ("if (input) {"); Script. Append ("if (Data.result && $.isarray (data.result.files)) {"); Script. Append ("Input.val (Data.result.files[0]. FILEURL); "); Script. Append ("} ");//IsArrayScript. Append ("} "); }            //Add by Wenjie//set the return value--hdnfileurl            if(Returnvalueformfieldclientid2.length >0) {script. Append ("var input2 = $ (' #"+ ReturnValueFormFieldClientId2 +"'); "); Script. Append ("if (input2) {"); Script. Append ("if (Data.result && $.isarray (data.result.files)) {"); Script. Append ("Input2.val (Data.result.files[0]. FILEURL); "); Script. Append ("} ");//IsArrayScript. Append ("} "); }            //set the return value directly by clicking the Btnsubmit button            if(Returnvalueformfieldclientid3.length >0) {script. Append ("var input3 = $ (' #"+ ReturnValueFormFieldClientId3 +"'); "); Script. Append ("if (input3) {"); Script. Append ("Input3.click ();"); Script. Append ("} "); }
   //return value        Private stringReturnvalueformfieldclientid =string.        Empty; /// <summary>        ///if provided then the returnvalue from the service would be is populated in this form element///Typical use would be a hidden field/// </summary>[Themeable (false)]         Public stringReturnvalueformfieldclientid {Get{returnReturnvalueformfieldclientid;} Set{Returnvalueformfieldclientid =value;} }        //return value        Private stringRETURNVALUEFORMFIELDCLIENTID2 =string.        Empty; /// <summary>        ///if provided then the returnvalue from the service would be is populated in this form element///Typical use would be a hidden field/// </summary>[Themeable (false)]         Public stringRETURNVALUEFORMFIELDCLIENTID2 {Get{returnReturnValueFormFieldClientId2;} Set{returnValueFormFieldClientId2 =value;} }        //return value        Private stringRETURNVALUEFORMFIELDCLIENTID3 =string.        Empty; /// <summary>        ///if provided then the returnvalue from the service would be is populated in this form element///Typical use would be a hidden field/// </summary>[Themeable (false)]         Public stringRETURNVALUEFORMFIELDCLIENTID3 {Get{returnReturnValueFormFieldClientId3;} Set{returnValueFormFieldClientId3 =value;} }

In Service/fileservice.ashx

String newfilename = DateTime.Now.ToString ("Yyyymmddmmss") + path.getfilename (fileuploaded.filename). Tocleanfilename (Webconfigsettings.forcelowercaseforuploadedfiles);

  

Edit Image Upload

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.