Article View: borland.public.cppbuilder.internet.web
Article #1016Re: CGI how to write program for accepting file uploaded to server
From: Hans Galema
Date: Sun, 23 Oct 2005 13:58
Date: Sun, 23 Oct 2005 13:58
23 lines
2019 bytes
2019 bytes
zhangsn wrote: > I do not start to write code. because it is my touch on CGI at the fourth > day. You better start writing code and do some testing. First make a .txt file (notepad) with a known content. Then upload it. Your cgi-exe can read CONTENT_LENGTH bytes from stdin. Write all to a file. Then examine the file. You will find the content of the original file back and something added in front and after. Then you will know how to handle Content -Type: text/plain. After having done so you could try with a known .html file. What kind of files should the browser upload ? Well all may be specified in a RFC. But I did find it out as described for some types. Incredibly the formatting/coding is different for nearly all different filetypes. But who will you blame ? Hans. Please trim quotes.
Technical Details
Message-ID:
<435b9697@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!zen.net.uk!dedekind.zen.co.uk!news-out.usenet.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<435a2142@newsgroups.borland.com> <435a3d89@newsgroups.borland.com> <435a4548$1@newsgroups.borland.com> <435ad565@newsgroups.borland.com> <435b67d8$1@newsgroups.borland.com> <435b780e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,943780c8a609b3ea X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Sun, 23 Oct 2005 15:58:27 +0200 From: Hans Galema <notused@notused.nl> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.web Subject: Re: CGI how to write program for accepting file uploaded to server References: <435a2142@newsgroups.borland.com> <435a3d89@newsgroups.borland.com> <435a4548$1@newsgroups.borland.com> <435ad565@newsgroups.borland.com> <435b67d8$1@newsgroups.borland.com> <435b780e@newsgroups.borland.com> In-Reply-To: <435b780e@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 145.98.201.248 Message-ID: <435b9697@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1130075799 145.98.201.248 (23 Oct 2005 06:56:39 -0700) Lines: 23 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!zen.net.uk!dedekind.zen.co.uk!news-out.usenet.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail