Cannot modify header information in ScriptCase application

Hello Guys,
I am wondering how to user PHP header function in form and grids of ScriptCase application. I have database with blob data type and provided with type of file stored in. I need to change header of one field on the fly say for image png files header(‘content-type: images/png’); I nave to use. But my application is giving me an error

Error
Cannot modify header information - headers already sent by (output started at /opt/nm/v6/www/scriptcase/prod/lib/php/nm_trata_saida.php:52)

I googled this error, most of people telling to create new PHP file or include some function at beginning of script file, which are impossible in SC application AFAIK. How can we get rid of this problem. Thanks.


Milind Wakale

Can you describe what you want to achieve? I need to generate a standard text document in a control app. After processing (substituting fields for data) I need to be able to let the customer download the document which is then openend by MsWord. I need supply a html header. Since you cannot do that in a regular application I do a sc_redir to a blank application. You can set header information there. Not sure if this trick works for you though.

I want to display profile pictures of users on their profile view page along with their details. The picture is stored in the database having blob as datatype of attribute containing picture. I just want to display profile details, and on view profile form it is displaying lot of garbage data of image as header is not set for displaying image. When I tried to put header in the code, above error comes and displayed garbage data too.

If you have the image stored in a blob in your database then you simply need to create a field of type image/database. If the form is in read-only it will show you the picture on your designed field. If the page is in edit mode you would be able to change the picture. So actually I don’t see why you need the html headers as you will not be able to access images from your database this way. But even then, if the images are on your \images directory you can access them as a simple image url which is also a datatype… Am I missing the point? It’s a bit confusing for me.

Yes, this might be point of confusion but if you look at the above error carefully, I am using version 6 of ScriptCase in which there is no such image database field for blob type. I made research and found that this field available in version 7 of ScriptCase. That’s why I have to do this manually.

Whatever, now I am trying to create some scripts in library of my project and trying to use with sc_include micro. Thinking this might help me.

I fear that you’re wrong, there’s no difference in V6 or V7, see screenshot:

demo.jpg

demo.png