tags:

views:

53

answers:

3

hello i would like to know how would it be possible to create a manual php header example

header("Content-Disposition: form-data; name=\"$fieldname\"; filename=\"$filename\");

instead of using that i would like to create manual it as

$senddata = "Content-Disposition: form-data; name=\"$fieldname\"; filename=\"$filename\"".$nn;
A: 
ob_start();
.... other stuff ....
$senddata ="Content-Disposition: form-data; name=\"$fieldname\"; filename=\"$filename\"".$nn;
header($senddata);

?

baloo
A: 

If you need to get the fieldname and filename and some data is outputted before, you can look into output buffering

Ólafur Waage
A: 

This:

ob_start();

$senddata = "Content-Disposition: form-data; name=\"$fieldname\"; filename=\"$filename\"".$nn;

header($senddata);

but make sure that you have constructed the valid header.

Sarfraz