SEO Software
Closed Thread
Results 1 to 10 of 10

Thread: Uploading file

  1. #1

    Default Uploading file

    Hello

    I want to upload file on the server using form, how can I do it. I want to allow max. 2 MB files to be uploaded so please help me regarding this.

    Thank you


  2. #2

    Default

    You can use following code for uploading file to the server.

    PHP Code:
    String fname file1.PostedFile.FileName;
    string pathServer.Mappath("./images/");
    file1.PostedFile.Saveas(path); 
    make sure that you have a write permission set to the folder

  3. The Following 3 Users Say Thank You to techkid For This Useful Post:

    donald (05-06-2009), nikon (01-29-2009), viraj_zaveri (05-02-2009)

  4. #3

    Default

    I want to show a perfect logo gor the company in its website. So please help me out...

  5. #4

    Default

    Also tell me the code for the upload of the images if i had sored whole path of the image in the database table...

  6. #5

    Default

    uploding file means that you can upload any image from the database and show on your project

  7. #6

    Thumbs up

    Quote Originally Posted by techkid View Post
    You can use following code for uploading file to the server.

    PHP Code:
    String fname file1.PostedFile.FileName;
    string pathServer.Mappath("./images/");
    file1.PostedFile.Saveas(path); 
    make sure that you have a write permission set to the folder
    hi techkid..
    thank you very very much...
    its too muck helpful to me also...
    thanks for a replying ina good way that everyone can understand....
    now if i have a doubt in any topic then just like to ask you directly...
    if you dont mind..
    ......CAN I ASK........

  8. #7
    Fulltime Member viraj_zaveri is on a distinguished road viraj_zaveri's Avatar
    Join Date
    Apr 2009
    Location
    GUJARAT,INDIA
    Posts
    744
    Thanks
    192
    Thanked 44 Times in 42 Posts

    Default

    Quote Originally Posted by techkid View Post
    You can use following code for uploading file to the server.

    PHP Code:
    String fname file1.PostedFile.FileName;
    string pathServer.Mappath("./images/");
    file1.PostedFile.Saveas(path); 
    make sure that you have a write permission set to the folder
    Thanks for your wonderful help mate.
    Keep sharing this kind of things.

  9. #8

    Default

    For uploading file on the server you need appropriate permission to write content in the location. [ Host_Name\ ASPNET ] user must have the permission in the specified folder.

    Code:

    private void Button1_Click(object sender, System.EventArgs e)
    {
    if((this.file1.PostedFile !=null) && (this.file1.PostedFile.ContentLength >0))
    {

    try
    {
    string FileName=System.IO.Path.GetFileName(file1.PostedFi le.FileName);
    string SaveLocation=Server.MapPath("Data") + "\\" + FileName;
    this.file1.PostedFile.SaveAs(SaveLocation);
    Response.Write("File Uploaded !");
    }
    catch(Exception Ex)
    {
    Response.Write(Ex.Message);
    }

    }

    }

  10. #9

    Default

    is it possible to upload multiple files with the asp.net and single file component? I want comma seperated one

  11. #10

    Default

    You need an FTP client, use WS_FTP, you must configure it with the information provided by your server owner, as domain name, administrator and password... don't worry, it's easy...

Closed Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts