Upload files

It's much simpler now , And it's much more beautiful , Reference resources This example .

 1: <ext:SimpleForm ID="SimpleForm1" BodyPadding="5px" runat="server" EnableBackgroundColor="true"
 2: ShowBorder="True" Title=" Forms " Width="350px" ShowHeader="True">
 3: <Items>
 4: <ext:TextBox runat="server" Label=" user name " ID="tbxUseraName" Required="true" ShowRedStar="true">
 5: </ext:TextBox>
 6: <ext:FileUpload runat="server" ID="filePhoto" EmptyText=" Please select a photo " Label=" Personal portrait " Required="true"
 7: ShowRedStar="true">
 8: </ext:FileUpload>
 9: <ext:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" ValidateForms="SimpleForm1"
 10: Text=" Submit ">
 11: </ext:Button>
 12: </Items>
 13: </ext:SimpleForm>

 1: protected void btnSubmit_Click(object sender, EventArgs e)
 2: {
 3: string fileName = DateTime.Now.Ticks.ToString() + "_" + filePhoto.FileName;
 4: if (filePhoto.HasFile)
 5: {
 6: filePhoto.SaveAs(Server.MapPath("~/upload/" + fileName));
 7: }
 8: }

So let's see FileUpload Properties of :

  1. ButtonText: Button text .
  2. ButtonOnly: Whether to display only buttons , Do not display read-only input box .
  3. ButtonIcon: Button icon .
  4. ButtonIconUrl: Button icon address .
  5. PostedFile: Uploaded files .
  6. HasFile: Whether it contains files .
  7. FileName: Upload file name .

There is another important way SaveAs, Used to save the uploaded text to the server .

FineUI Upload more articles about controls

  1. Baidu flash html5 Self switching Multi file asynchronous upload control webuploader Basic usage

    Dual core browser in chrome The kernel uses uploadify There is always 302 problem , I don't know how to fix it , I like 360 The browser is to help customers control the rendering kernel : If the page needs to use speed kernel by default , labeling :<meta name=& ...

  2. For Baidu WebUploader Secondary encapsulation of open source upload control , Streamline the front-end code ( Two sentences of code to upload )

    Preface First of all, let's make a statement , I'm right WebUploader Secondary encapsulation of open source upload control , The bottom is still WebUploader Realized , Just to use it more succinctly . Here to tell us about WebUploader brief introduction : WebUp ...

  3. be based on AngularJs Upload control for -angular-file-upload

    What I want to share with you today is a problem that depends on angular Upload control for . Some time ago, when I was working on a project, I met a need to upload files , It's like this , See the picture below : You need to upload two files at the same time . And specify the file format and file size . Because the front-end framework uses ...

  4. [ turn ]html5 Form upload control Files API

    Form upload control :<input type="file" />(IE9 And below do not support the following functions , The latest versions of other browsers support .) 1. Number of files allowed to be uploaded Allow multiple files to be selected :< ...

  5. jquery Local upload preview extension ( Hide upload control click image upload support ie!!)

    The raw material address I use :http://www.cnblogs.com/leejersey/p/3660202.html After modification : /// <reference path="../../Js ...

  6. flash Upload controls across domains

    Work need to use Baidu development ueditor, But in server deployment, the front-end code and the back-end code are under different domain names , The cross domain problem of front-end calling back-end code has been solved . But ,ueditor Upload images in flash Control also involves cross domain issues , After searching, we found that ...

  7. jquery File upload control Uploadify

    ( from http://www.cnblogs.com/mofish/archive/2012/11/30/2796698.html) be based on jquery File upload control for , Support ajax No refresh upload , Multiple files are the same ...

  8. Use Uploadify(UploadiFive) Multi file upload control encountered the pit

    Recently, the project needs to achieve multi file upload function , So we finally chose Uploadify This is a control to achieve . Compared to other controls ,Uploadify With a simple interface , function API It can basically solve most of the needs , It's based on jquery Of , with ...

  9. use jQuery File Upload Do upload control demo, Support multiple upload buttons on the same page

    demand There is such a need , One form There are multiple files to upload , But it's not the traditional way of uploading pictures in batches , It's a requirement like the one shown in the figure below , It started with swfupload Do upload , But the problem is if there are multiple buttons , It's a lot of repetitive code to write , For ...

Random recommendation

  1. input usage , Always wait , Until the user enters a value assigned to something .

    input usage , Always wait , Until the user enters a value assigned to something . n1 = input(' Please enter a user name :') n1 = input(' Please input a password :') print(n1) print(n1)

  2. barabasilab-networkScience Learning notes 6-evolving networks

    My first contact with complexity science was in a book called think complexity In my book ,Allen The doctor talked about the science of data structure and complexity very well ,barabasi Is a well-known complexity network scientist ,barabasilab It's him who leads the way ...

  3. System.Web.HttpRequestValidationException—— Dangerous... Detected from client Request value

    This is a common problem , If Web There is input in the form similar to Html Text like labels , Through Request.QueryString perhaps Request.Form When passing these values , It triggers an exception like this , Because of script injection, etc ...

  4. 【ERROR】 Use jquery Of ajax appear error:readyState=4,status=500

    Use jquery Of ajax appear error:readyState=4,status=500,ajax The code is as follows : $.ajax({ url : "../toBeFinMisManage/show ...

  5. linux Next c/c++ IDE Introduction to development tools

    To avoid one of the following software installation does not automatically install build-essential You might as well do it first : sudo apt-get install build-essential [ edit  ]anjuta Anjuta Dev ...

  6. 【 mathematics 】XMU 1597 GCD

    Topic link : http://acm.xmu.edu.cn/JudgeOnline/problem.php?id=1597 The main idea of the topic : seek (am-bm, an-bn), The results were modelled 1000000007,a,b ...

  7. feature selection (feature_selection)

    Catalog feature selection (feature_selection) Filter 1. Remove low variance features (Removing features with low variance) 2. Univariate feature selection (Uni ...

  8. webgl And 3d Animation

    Previous articles are static , And here's how to make things move , And learn to use performance monitors to monitor performance . And if you want things to move , In fact, we have two ways , The first is to make objects really move , The other is to make the camera move so that the object ...

  9. Nuget Summary of my study

    Nuget Summary of my study I studied it today nuget, Find out nuget It's so useful , I wrote this blog , I hope to record my learning experience , I also hope that friends in the technology circle will see it , If it's not good enough , You can give me some valuable advice , With ...

  10. java The three party ----&gt;dom4j analysis xml data

    Dom4j It's an easy to use . Open source library , be used for XML,XPath and XSLT. It is applied to Java platform , Adopted Java Set framework and fully support DOM,SAX and JAXP. Today we start Dom4j Learning from . Dom4j Use ...