CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    7

    Problems in Writing CGI in C on NT to handle file upload

    Hello everyone,

    I am trying to write a CGI in C to run on NT. The CGI is to
    handle file upload from client html. The client html is as follow:

    <FORM ACTION="http://192.168.0.12/scripts/securein/filetrans.exe" ENCTYPE="multipart/form-data" METHOD="POST">
    Attach file <input type="file" name="filename">


    <input type=submit value=submit name=submit>
    </FORM>

    So, on the CGI side, I just write some codes to read in the char stream
    from stdin and parse it; the content of the file is in one of the
    'content-disposition' section, right?

    I tested it and it works with small files; the file content is in 'content-disposition' section.

    However, when I try with a file of a few hundred KB, I get the error
    "The Internet Explorer cannot open the site http://192..../filetrans.exe
    The connection with the server was reset."

    I just cannot understand why this happen. I commented all the lines in the
    cgi script and have it just print a simple string, it still happens.

    Just do not where to fix it! I downloaded a cgi exe from CGI Resource Index
    and it never have this problem regardless of file size. However, no source code
    is available for my research.

    Please tell me what is wrong.

    rehards,
    shumman



  2. #2
    Join Date
    Jun 1999
    Posts
    4

    Re: Problems in Writing CGI in C on NT to handle file upload

    Hi shumman
    I'm also trying to upload files from client machine. I've downloaded sample control from www.aspupload.com. It is working fine when using from browser. ie using input=file tag.
    But when I'm wring the client program using vc++ I'm unable to do that. Since you have already succeeded for small files, I want to know how u did that? Can I have your source code?

    Thank you
    Harish


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured