Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to send binary to client by asp

Posted on 2000-03-22
6
Medium Priority
?
451 Views
Last Modified: 2008-01-09
i want create binary file by asp. and then send it to client.
Can you help me ?
thanks
0
Comment
Question by:longpxt
6 Comments
 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 2648107
You may write ActiveX and use it in ASP page
0
 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 2648130
For example: ActiveX obtain parameters and pass to ASP SafeArray with binary context of file.
<%
  Set o = CreateObject("myobj.filegen")
  o.param = "blahblah"
  Response.ContextType = "mytype/myformat"
  Response.BinaryWrite o.GeFile
%>
0
 
LVL 1

Expert Comment

by:msvarma
ID: 2648261
Well Mr.longpxt I think the below code should help U.


<!-- To create a Binary File in ASP //-->
<%Set ms = CreateObject("Scripting.FileSystemObject")%>
<% msv = "whatever text u want to send"%>
<%Set a = ms.CreateTextFile(msv,True)%>
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 2652975
What are you waiting for?
0
 

Accepted Solution

by:
Ablater earned 600 total points
ID: 2655698
Yury,

Outputting binary is achieved in visual basic by using the reponse.binarywrite function. This functions differs from the standard response.write by allowing binary characters (that would otherwise cause problems with request) to be written to the client.

It's easy enough to use visual basic to write a binary loader, so that you could for example read an image. You'll just load the binary of the file into a byte array, or variant, and pass it back to the calling page with your active X object.

There is one important consideration however when using this method: The type of binary file you are sending to your client. These are in the standard mime type format. You'll need to check which one will fit your application.

image/gif is for a .gif file for example, while image/jpeg is for a JPEG file. You need to specify the content type. (Check your help file for this, it is there)

It goes something like this:

<% Response.ContentType = "image/JPEG" %>

You have to also remove ALL HTML headers. Visual Interdev likes to fill these in, and if they (or any spaces or additional characters other than the file type) are there, they will corrupt your file transfer.

You also need an active X object to deliver the binary data to you. The built in filesystem object of ASP only does text files. (You can load them, but they corrupt when you transfer them)


0
 

Author Comment

by:longpxt
ID: 2655735
I don't know how to create built activeX object to deliver the binary data.
You can give me location of this object to download it
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Integration Management Part 2
Loops Section Overview
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question