Note that there are some explanatory texts on larger screens.

plurals
  1. POContentType doesnt work, mime=application/octet-stream
    primarykey
    data
    text
    <p>In C# i am doing</p> <pre><code> context.Response.ContentType = "image/png"; context.RewritePath(sz); context.Response.ContentType = "image/png"; </code></pre> <p>It seems to redirect the path as i can see see images on my pages. However in firefox when i right click and select "view image" i get a download. Using this c++ code i can see the mime being application/octet-stream</p> <pre><code>#include &lt;curl/curl.h&gt; #include &lt;ios&gt; #include &lt;iostream&gt; #include &lt;string&gt; #pragma comment(lib, "curllib") using namespace std; size_t function( void *ptr, size_t size, size_t nmemb, void *stream) { cout &lt;&lt; (char*)ptr; return size*nmemb; } size_t function2( void *ptr, size_t size, size_t nmemb, void *stream) { return size*nmemb; } int main() { CURL *c = curl_easy_init(); curl_easy_setopt(c, CURLOPT_HEADERFUNCTION, function); curl_easy_setopt(c, CURLOPT_WRITEHEADER , 1); curl_easy_setopt(c, CURLOPT_WRITEFUNCTION, function2); curl_easy_setopt(c, CURLOPT_WRITEDATA, 0); curl_easy_setopt(c, CURLOPT_URL, "http://localhost:3288/s/main/4/AAA.png"); curl_easy_perform(c); curl_easy_cleanup(c); return 0; } </code></pre> <p>My question is how do i set the mime to the correct type? Above i hardcode it to png which doesnt work. However i rather not hardcode any mime and have it work. I was able to redirect an XML file to somefile.aspx and have that the page set the content type and generate the XML. However rewriting to the image path seems to let the image work i just dont get the correct type.</p> <p>How do i correct the content/mime type? As plan B i'll rewrite to a aspx file. Whats the best way to send an image? Could i do something like context.Response.OutputStream=stream("filename"); ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload