 |
|
|
I have a VB6 COM component pushing a zip file to IE 6 and it fails (however it works fine with FireFox!)
The VB6 code is here:
Set objResponse = ParentSession.Response Set objFile = objFSO.GetFile(strAbsFile) objResponse.Clear '-- the filename you give it will be the one that is shown to the users by default when they save objResponse.Buffer = True objResponse.AddHeader "Content-Disposition", "attachment; filename=" & strDisplayFileName objResponse.AddHeader "Content-Length", objFile.Size If FileFormat = "zip" Then objResponse.ContentType = "application/x-zip-compressed" ElseIf FileFormat = "pdf" Then objResponse.ContentType = "application/pdf" Else If strContentMimeType = "" Then '--We don't know what kind of file this is so we'll set the content type to generic and hope that it works. This should never happen. USER_AGENT = objRequest.ServerVariables("HTTP_USER_AGENT") 'test USER-AGENT header If InStr(UCase(USER_AGENT), "MSIE") <> 0 Then objResponse.ContentType = "application/x-msdownload" Else 'netscape, opera, et. al. likes "application/octet-stream" objResponse.ContentType = "application/octet-stream" End If Else objResponse.ContentType = strContentMimeType End If End If Set objStream = New ADODB.Stream objStream.Open objStream.Type = 1 ' adTypeBinary objStream.LoadFromFile strAbsFile objResponse.BinaryWrite objStream.Read objResponse.Flush
-- code ends
How can I determine the error please?
Thank you,
Piyush Varma
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I had given the play and download options for the music files in my web page. when we download the file 0 bytes downloading...pls...anyone help me 
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
I had given the play and download options for the music files in my web page. one file is working smoothly. but when we download the other one 0 bytes downloading...pls...anyone help me 
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
how can i down load a file or image from web to the location defined by browsing, please help me write the function in asp.net.
thanks noor alam
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
Hi there
i got the following error when i run the program in asp.net 2.0
ActiveX component can't create object FileTransfer.BinaryRead.
Can any one give the solution?
Thanks in Advance Priya .B
|
| Sign In·View Thread·PermaLink | 1.00/5 (2 votes) |
|
|
|
 |
|
|
 |
|
|
 |
|
|
i m getting garbage text when i open a .doc file what i want is that if i open a .doc file it should directly open in MS word
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
can anybody tell me how to display vc++ output string on a browser using asp. I am using vbscript for asp.
From Rakesh
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
plz tell me how 2 get download pop up window?..so that user could save file on his machine...i m able 2 get the file from server on screen...Thanx in advance
|
| Sign In·View Thread·PermaLink | 1.33/5 (3 votes) |
|
|
|
 |
|
|
Currently, i using IIS5.0 when i tried to run the test.asp it's shown an error as below shown:
Error Type: Microsoft VBScript runtime (0x800A0046) Permission denied: 'CreateObject' /asp/download/codeProject/test.asp, line 8
Do anyone do let me know how i need to set a mime and solve my problem that currently facing.
Help...help 
|
| Sign In·View Thread·PermaLink | 1.67/5 (3 votes) |
|
|
|
 |
|
|
 |
|
|
Hi all:
Can any one teach me how to write a link which is connect to a executable file like "test.exe", and when someone click the link, the test.exe will be auto executed without saving it first? Thanks for your answer. ^__^
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hello everybody,
I'm Roland and new to this community. I tried out the FileTransfer component and everything works fine with VBScript. However, I prefer to program in JavaScript as this is closer to "C" which we use for our application.
The file to be transferred is an executable.
With the Javascript I get the following error: Error Type: Response object, ASP 0106 (0x80020005) An unhandled data type was encountered. Error line: Response.BinaryWrite(saBinFile) ;
Anybody who can help me? Both scripts below.
Many thanks in advance, Roland 
VBSCRIPT <% Option Explicit Dim objBinaryRead Dim saBinFile Dim bDownloadStatus Dim FilePath
FilePath = "c:\Inetpub\wwwroot\MyWeb\MyFile.exe"
Set objBinaryRead = CreateObject("FileTransfer.BinaryRead") Response.Buffer = true Response.ContentType = "application/x-msdownload" Response.AddHeader "content-disposition", "filename=MyFile.exe"
saBinFile = objBinaryRead.ReadBinFile(FilePath) Response.BinaryWrite saBinFile
Set saBinFile = nothing Set objBinaryRead = nothing %>
JAVASCRIPT <%@ LANGUAGE = JavaScript %> <% Response.Buffer = "True" ; Response.ContentType = "application/x-msdownload" ;
var objBinaryRead = Server.CreateObject("FileTransfer.BinaryRead") ; var FilePath = "c:\Inetpub\wwwroot\MyWeb\MyFile.exe" ;
Response.AddHeader("content-disposition", "filename=MyFile.exe") ;
var saBinFile = objBinaryRead.ReadBinFile(FilePath) ; Response.BinaryWrite(saBinFile) ; saBinFile = null ; objBinaryRead = null ; Response.End ; %>
|
| Sign In·View Thread·PermaLink | 3.25/5 (3 votes) |
|
|
|
 |
|
|
Has anyone had luck to download exe corectly (eDrawing presentation) with File Transfer Object? After download with File Transfer Object, exe not works. Tanks for any help.
Source: Server.CreateObject("FileTransfer.BinaryRead") Response.Buffer = true Response.ContentType ="application/exe" Response.Addheader "Content-Disposition", "inline; filename=fileName.exe" mStream = objBinFile.ResponseBinaryWrite(fileName, Response) Set objBinFile = Nothing
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
I just found that I can download small size file. I successfully download a test.txt. I just couldn't download .zip file no matter how big or small the zip file is.
Any comment?
|
| Sign In·View Thread·PermaLink | 1.00/5 (2 votes) |
|
|
|
 |
|
|
Sorry for my careless mistake.
I am successfully download the zip file using the object.
What I missed was the file security setting.
For some reason, I've turn it OFF.
Sorry again. And Yippy, I did it.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
use Server.Transfer, without this component.
<%@language="jscript"%> <% Response.AddHeader("Content-Disposition","filename=test.zip"); Server.Transfer("/CharmWWW/test/test2.zip"); %>
I checked it with Getright and other progs, and I couldn't sense the "real" source file. Just the dl.asp, which contains these asp lines. I'm not 100% sure about it.
You may know that Response.Redirect takes another turn, while Server.Transfer passes the processing to another file on the server.
Succesful targets: - mask source path - possibility to include download security - fastest processing - real source filename and the response filename can be different
Stewe
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
If my test.zip contained onlyt one text file call test.txt and the test.txt is 7 bytes in length, the downloaded test.zip will be zero in byte.
It will fail if the zip is too small. Why does this happen?
Any idea or solution?
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
I had the same problem, but with larger files, too.
That's because I tried to use from js, not vb. My line was: var bDownloadStatus = objBinaryRead.ResponseBinaryWrite("c:\temp\test.zip", Response); The error was that it's js, so I have to use \\ instead of \. It means the component writes 0 bytes to the stream if it can't find the file.
Stewe
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I can download larger file without any problem. My case is not caused by the \\ or \. I use vbscript.
I still can download the small zip file which contained only one plain text file.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
I have a web based application writeen using an Access Database and ASP. At the moment I click a link that opens a new browser window and displays the data from the previous asp page in an excel file.
What I want to happen is, is when the link is clicked the window opens, the excel file is created AND the user showed a "SAVE AS" dialog window to save the file to their local machine. The Excel file should be shown in the window.
Any help greatly appreciated. Thanks.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
I am allowing users to download a excel file. After the user has downloaded the file ,how to know where he had saved the file in his computer. Can anybody give me suggestions in this regard ? Thanks in advance.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |