Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Retrieving a binary file from a database and naminig the downloaded file explicitly

Reply
Thread Tools

Retrieving a binary file from a database and naminig the downloaded file explicitly

 
 
James Cooke
Guest
Posts: n/a
 
      08-15-2003
I succesfull yam able to download binary data by calling a page called
BinaryData.aspx. BinaryData.aspx gets the binary data from the database,
and displays it as such:

Response.Buffer = True
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = binaryFieldType
Response.BinaryWrite(binaryField)
Response.End()

This then produces a download called

BinaryData.ZIP, or
BinaryData.MDB or
BinaryData.PDF
with the file extension differing depending on what the ContentType is.

My question: I want to be able to change the *root* name of the download to
something else - for example
MyData.ZIP, or
Customers.MDB or
Document1.PDF

How? Am I using the wrong approach in extracting this binary data, and if
so, where do I start looking?
thanks in advance




 
Reply With Quote
 
 
 
 
James Cooke
Guest
Posts: n/a
 
      08-15-2003
you are a star! thanks for the rapid response Steve!
"Steve C. Orr, MCSD" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> You need to add this line of code:
> Response.AddHeader("Content-Disposition","attachment;filename=" &
> strFileName)
>
> --
> I hope this helps,
> Steve C. Orr, MCSD
> http://Steve.Orr.net
> Developer for Hire
>
>
> "James Cooke" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I succesfull yam able to download binary data by calling a page called
> > BinaryData.aspx. BinaryData.aspx gets the binary data from the

database,
> > and displays it as such:
> >
> > Response.Buffer = True
> > Response.ClearContent()
> > Response.ClearHeaders()
> > Response.ContentType = binaryFieldType
> > Response.BinaryWrite(binaryField)
> > Response.End()
> >
> > This then produces a download called
> >
> > BinaryData.ZIP, or
> > BinaryData.MDB or
> > BinaryData.PDF
> > with the file extension differing depending on what the ContentType is.
> >
> > My question: I want to be able to change the *root* name of the download

> to
> > something else - for example
> > MyData.ZIP, or
> > Customers.MDB or
> > Document1.PDF
> >
> > How? Am I using the wrong approach in extracting this binary data, and

if
> > so, where do I start looking?
> > thanks in advance
> >
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
 
MS News \(MS ILM\)
Guest
Posts: n/a
 
      08-15-2003
Steve is a big STAR I vote for him

"James Cooke" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> you are a star! thanks for the rapid response Steve!
> "Steve C. Orr, MCSD" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > You need to add this line of code:
> > Response.AddHeader("Content-Disposition","attachment;filename=" &
> > strFileName)
> >
> > --
> > I hope this helps,
> > Steve C. Orr, MCSD
> > http://Steve.Orr.net
> > Developer for Hire
> >
> >
> > "James Cooke" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > I succesfull yam able to download binary data by calling a page called
> > > BinaryData.aspx. BinaryData.aspx gets the binary data from the

> database,
> > > and displays it as such:
> > >
> > > Response.Buffer = True
> > > Response.ClearContent()
> > > Response.ClearHeaders()
> > > Response.ContentType = binaryFieldType
> > > Response.BinaryWrite(binaryField)
> > > Response.End()
> > >
> > > This then produces a download called
> > >
> > > BinaryData.ZIP, or
> > > BinaryData.MDB or
> > > BinaryData.PDF
> > > with the file extension differing depending on what the ContentType

is.
> > >
> > > My question: I want to be able to change the *root* name of the

download
> > to
> > > something else - for example
> > > MyData.ZIP, or
> > > Customers.MDB or
> > > Document1.PDF
> > >
> > > How? Am I using the wrong approach in extracting this binary data, and

> if
> > > so, where do I start looking?
> > > thanks in advance
> > >
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
I saved password into the database with "binary" data type from GetByte method. How can I to compare the password that between database and transfered from the page? Benny Ng ASP .Net 3 01-25-2006 06:49 AM
Kazaa Has massive database of all files downloaded by users Justin Computer Support 0 02-07-2005 05:32 PM
how can I read the downloaded binary files ? help, please djdelmas Computer Support 4 01-09-2005 11:39 PM



Advertisments