<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Größe einer hochgeladenen Datei herausfinden]]></title><description><![CDATA[<p>Hallo....<br />
öhm.. wie kann ich herausfinden, wie groß eine Datei hinter einer URL ist? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/192780/größe-einer-hochgeladenen-datei-herausfinden</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 21:34:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/192780.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Sep 2007 15:44:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Größe einer hochgeladenen Datei herausfinden on Tue, 18 Sep 2007 15:44:21 GMT]]></title><description><![CDATA[<p>Hallo....<br />
öhm.. wie kann ich herausfinden, wie groß eine Datei hinter einer URL ist? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1367861</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1367861</guid><dc:creator><![CDATA[wiegroßei..]]></dc:creator><pubDate>Tue, 18 Sep 2007 15:44:21 GMT</pubDate></item><item><title><![CDATA[Reply to Größe einer hochgeladenen Datei herausfinden on Tue, 18 Sep 2007 15:46:23 GMT]]></title><description><![CDATA[<p>Einfach den Wert unter einer Variable speihern.<br />
Evt. musst du mit dem buffer arbeiten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1367863</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1367863</guid><dc:creator><![CDATA[pivke]]></dc:creator><pubDate>Tue, 18 Sep 2007 15:46:23 GMT</pubDate></item><item><title><![CDATA[Reply to Größe einer hochgeladenen Datei herausfinden on Tue, 18 Sep 2007 15:52:24 GMT]]></title><description><![CDATA[<p>Meinst du, zuerst mit InternetReadFile solange Teile der Datei einlesen, bis man sie ganz hat, und dann einfach nur gucken, wie viel man eingelesen hat? <sub>_</sub>''</p>
<p>Anders/Besser geht es nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1367870</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1367870</guid><dc:creator><![CDATA[wiegroßei..]]></dc:creator><pubDate>Tue, 18 Sep 2007 15:52:24 GMT</pubDate></item><item><title><![CDATA[Reply to Größe einer hochgeladenen Datei herausfinden on Tue, 18 Sep 2007 15:55:35 GMT]]></title><description><![CDATA[<p>Kannst mal mit HttpQueryInfo und HTTP_QUERY_CONTENT_LENGTH probieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1367875</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1367875</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Tue, 18 Sep 2007 15:55:35 GMT</pubDate></item><item><title><![CDATA[Reply to Größe einer hochgeladenen Datei herausfinden on Tue, 18 Sep 2007 15:58:25 GMT]]></title><description><![CDATA[<p>Hört sich gut an, ich schau mal, was sich dahinter verbirgt</p>
<p>Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1367879</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1367879</guid><dc:creator><![CDATA[wiegroßei..]]></dc:creator><pubDate>Tue, 18 Sep 2007 15:58:25 GMT</pubDate></item><item><title><![CDATA[Reply to Größe einer hochgeladenen Datei herausfinden on Tue, 18 Sep 2007 15:59:13 GMT]]></title><description><![CDATA[<p>PS:<br />
Aber die Datei herunter zu laden funktioniert besser mit InternetReadFile?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1367881</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1367881</guid><dc:creator><![CDATA[wiegroßei..]]></dc:creator><pubDate>Tue, 18 Sep 2007 15:59:13 GMT</pubDate></item><item><title><![CDATA[Reply to Größe einer hochgeladenen Datei herausfinden on Tue, 18 Sep 2007 16:29:54 GMT]]></title><description><![CDATA[<p>Irgendwíe bek0mme ich das nicht hin...</p>
<p>Bei mir kommt etwas gaaanz anderes heraus, als die Größe der Datei</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1367910</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1367910</guid><dc:creator><![CDATA[wiegroßei..]]></dc:creator><pubDate>Tue, 18 Sep 2007 16:29:54 GMT</pubDate></item><item><title><![CDATA[Reply to Größe einer hochgeladenen Datei herausfinden on Tue, 18 Sep 2007 16:35:38 GMT]]></title><description><![CDATA[<p>Haste auch richtig deklariert ?<br />
Poste doch mal deinen Code.<br />
Man übersieht schonmal öfters etwas.<br />
Schamuer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1367917</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1367917</guid><dc:creator><![CDATA[pivke]]></dc:creator><pubDate>Tue, 18 Sep 2007 16:35:38 GMT</pubDate></item><item><title><![CDATA[Reply to Größe einer hochgeladenen Datei herausfinden on Tue, 18 Sep 2007 16:38:44 GMT]]></title><description><![CDATA[<p><a href="http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarwebtool/html/msdn_inet.asp" rel="nofollow">http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarwebtool/html/msdn_inet.asp</a></p>
<p>MSDN schrieb:</p>
<blockquote>
<p>Let's say that we want to get the size of the HTML page before downloading it so that we can allocate a buffer in the exact size. HttpQueryInfo will get the size of the Web page.</p>
<p>A word of caution: Not all Web pages support getting the page size. (For example, <a href="http://www.toystory.com" rel="nofollow">www.toystory.com</a> and <a href="http://www.movielink.com" rel="nofollow">www.movielink.com</a> don't support this functionality.) Also, TCP/IP can send less data than requested. Therefore, your application should handle both of these cases and loop around InternetReadFile until the result is True and *lpdwNumberOfBytesRead is 0.</p>
<p>The code to open the file <a href="http://www.microsoft.com/msdn/msdninfo/" rel="nofollow">http://www.microsoft.com/msdn/msdninfo/</a> using HttpOpenRequest, HttpSendRequest, and HttpQueryInfo is shown below. The error checking has been removed.</p>
</blockquote>
<pre><code class="language-cpp">// Open Internet session.
HINTERNET hSession = ::InternetOpen(&quot;MSDN SurfBear&quot;,
                                    PRE_CONFIG_INTERNET_ACCESS,
                                    NULL, 
                                    INTERNET_INVALID_PORT_NUMBER,
                                    0) ;

// Connect to www.microsoft.com.
HINTERNET hConnect = ::InternetConnect(hSession,
                                    &quot;www.microsoft.com&quot;,
                                    INTERNET_INVALID_PORT_NUMBER,
                                    &quot;&quot;,
                                    &quot;&quot;,
                                    INTERNET_SERVICE_HTTP,
                                    0,
                                    0) ;

// Request the file /MSDN/MSDNINFO/ from the server.
HINTERNET hHttpFile = ::HttpOpenRequest(hConnect,
                                     &quot;GET&quot;,
                                     &quot;/MSDN/MSDNINFO/&quot;,
                                     HTTP_VERSION,
                                     NULL,
                                     0,
                                     INTERNET_FLAG_DONT_CACHE,
                                     0) ;

// Send the request.
BOOL bSendRequest = ::HttpSendRequest(hHttpFile, NULL, 0, 0, 0);

// Get the length of the file.            
char bufQuery[32] ;
DWORD dwLengthBufQuery = sizeof(bufQuery);
BOOL bQuery = ::HttpQueryInfo(hHttpFile,
                              HTTP_QUERY_CONTENT_LENGTH, 
                              bufQuery, 
                              &amp;dwLengthBufQuery) ;

// Convert length from ASCII string to a DWORD.
DWORD dwFileSize = (DWORD)atol(bufQuery) ;

// Allocate a buffer for the file.   
char* buffer = new char[dwFileSize+1] ;

// Read the file into the buffer. 
DWORD dwBytesRead ;
BOOL bRead = ::InternetReadFile(hHttpFile,
                                buffer,
                                dwFileSize+1, 
                                &amp;dwBytesRead);
// Put a zero on the end of the buffer.
buffer[dwBytesRead] = 0 ;

// Close all of the Internet handles.
::InternetCloseHandle(hHttpFile); 
::InternetCloseHandle(hConnect) ;
::InternetCloseHandle(hSession) ;

// Display the file in an edit control.
pEditCtrl-&gt;SetWindowText(buffer) ;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1367919</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1367919</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Tue, 18 Sep 2007 16:38:44 GMT</pubDate></item></channel></rss>