http-headers

Why is Firefox prompting to download a file that is POST'd to?

This is the most peculiar thing. It is from an old in house CMS. When I attempt to submit my changes, it prompts to save the file linked in the action attribute of the form. Headers Request POST /~site/edit/articles/article_save.php?id=54 HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; r...

HTTP header for sending PDF, problem in Firefox

In windows when i save a pdf with firefox adobe reader plugin ocurs this problem. The file saved is: http://www.example.com/opendocument.php_doc=._docs_doc01 My headers are: header('Content-type: application/pdf'); //header('Content-Disposition: inline; filename=doc01.pdf'); header("Content-Transfer-Encoding: binary"); header("Content...

Content-disposition:inline header won't show images inline?

I'm trying to show an image inline on a page. It is being served by a codeigniter controller. class Asset extends MY_Controller { function index( $folder, $file ) { $asset = "assets/$folder/$file"; if ( !file_exists( $asset ) ) { show_404(); return; } switch ( $folder ) ...

Hot to get custom http-header in asp.net?

I have an asp.net appliction on the one server. There I've added code on server-side in Page_Load: Response.AddHeader("key", "password-key-from-hotel"); On the client side I have a form: <form ... action="www.link-to-another-domaint" > <input type="hidden" id="asd" value="fgh" > .... </form> <script type="text/javascript"> ...

IIS Integration testing: remove X-Powered-By: ASP.NET header

I want to have a test that testing the inexistent of this http headers, using NAnt and NUnit: X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Edit: I'm asking hot to actually test this rule: "don't have asp headers". so, I can have this test in each new website that I'm doing, so it make it easier no to forget this simple step. ...

Receive JSON payload with ZEND framework and / or PHP

I'm receiving a JSON payload from a webservice at my site's internal webpage at /asset/setjob. The following is the JSON payload being posted to /asset/setjob: [{"job": {"source_filename": "beer-drinking-pig.mpg", "current_step": "waiting_for_file", "encoding_profile_id": "nil", "resolution": "nil", ...

HttpWebRequest to a SSL web site on a server specified by IP address (WebProxy)

Following the idea about using a WebProxy to make an http request to a server by IP address as demonstrated in the following answers : Request Web Page in c# spoofing the Host Http Request - Bypass DNS [.Net] I'm trying to achive the same goal with an HTTPS request. I would like to still use an HttpWebRequest object in order to let th...

extract payload from tcpflow output

Tcpflow outputs a bunch of files, many of which are HTTP responses from a web server. Inside, they contain HTTP headers, including Content-type: , and other important ones. I'm trying to write a script that can extract just the payload data (i.e. image/jpeg; text/html; et al.) and save it to a file [optional: with an appropriate name an...

CakePHP sending multiple lines of same cookie information in response header. why??

Hi all, I am having this problem with one of my cakePHP applications. My application displays a big html table on the page. I noticed that when the table goes beyond a certain size limit, IE cannot display that page. While trying to figure out why this happens, I noticed that my html response header contains a HUGE number of lin...

How to force client browser to download images from server rather using its cache

Assume a simple aspx data entry page in which admin user can upload an image as well as some other data. They are stored in database and the next time admin visits that page to edit record, image data fetched and a preview generated and saved to disk (using GDI+) and the preview is shown in an image control. This procedure works fine fo...

Redirected wikipedia request

Hi people, i need to write a program, that can redirect's http://localhost:8080 to en.wikipedia.org, it seems to be easy, but i have some problems(only with wikipedia with another sites works good). I make url to wikipedia: URL url = new URL("http", "en.wikipedia.org", 80, "/wiki"); than URLConnection, extract headers, and when i wan...

ASP.NET MVC2 and Browser Caching

Hi I have a web application that fetches a lot of content via ajax. For example when a user edits some data, the browser will send the changes using an ajax post and then do an ajax get to get fresh content and replace an existing div on the page with that content. This was working just find with MVC1, but in MVC2 I would get inconsist...

Are there situations in which the following forwarding doesn't work?

I need to implement a forwarding. I did it the following way: <html> <head> <meta http-equiv="refresh" content="0; URL=http://www.xyz.com"&gt; </head> <body> </body> </html> Are there any situations in which this won't work? I read on selfhtml.org (http://de.selfhtml.org/html/kopfdaten/meta.htm#weiterleitung, sry for the german link c...

Should I Return "500" or "404" if a Requested Image is not Found?

I work with code written by other people, occasionally I am left somewhat confused and at these times Stack Overflow saves me. Please, save me again. Our site allows people to upload images and later embed them within text in our site like so: <img src="http://site.com/image_script.php?p=some_image_identifier"/&gt; My question is: I...

How to prevent my site page to be loaded via 3rd party site frame of iFrame

How can I find out that my page is embedded as a frame to other site during page loading? I guess referrer request header can't help me here? Thanks. ...

Fetching custom Authorization header from incoming PHP request

So I'm trying to parse an incoming request in PHP which has the following header set: Authorization: Custom Username Simple question: how on earth do I get my hands on it? If it was Authorization: Basic, I could get the username from $_SERVER["PHP_AUTH_USER"]. If it was X-Custom-Authorization: Username, I could get the username from...

Capture output from browser call using Selenium

I need to create a use case (using Selenium) in which I send HTTP calls with a Cookie through the browser and capture the return value in a text file. What do I need to do this, I have run this using CURL in the command line, but we are encountering issues with the same, and hence wish to verify using a real UI browser. Another thing t...

P3P Headers in ASP.NET

Hi Guys, I am implementing a solution basically for x-domain sign in using iFrames. So its like domain A.com is served into an iFrame in Domain B.com with the aim that a user who is logged in a Domain A.com is also logged into B.com iframe. At the moment - its working fine in FF and Chrome - but IE is causing me headaches. So I have a ...

X-Domain Cookies in iFrames

Hi Guys, I have a domain A.com which is my website. I want to allow the user to login and then I have embedded an iframe into domain B.com which attempts to grab the cookie from A.com to allow the user to be continued to be signed in. I can't seem to get this working in IE ? A new session gets set instead and the cookie is never retrie...

How to fake 404 in IIS7

I would like to set /directory/default.aspx to return 404 even though file and folder exist. How is this possible to do in IIS7 settings? Update: I would like to do this in IIS Manager, not on code. ...