Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: PROBLEM WITH DISPLAYING PDF FILES !!!!


Message #1 by "Vandael Tim" <vandael_tim@h...> on Fri, 26 Apr 2002 13:35:31
Hey,

i am having a problem with displaying PDF files, when i am trying to 
display the PDF file, i get the "file is damaged and could not be 
repaired" message.

This is the code i use in my main-page.
For each file, there is image with a form attached.

<form method="post" action="bekijk.asp">
	<td align="center" width="80">
	   <input type=image src="images/bekijk.jpg">
	   <input type="hidden" name="id" value="<%= rsnaam("instrID")%>">
	</td>
</form>

The information is sent to "bekijk.asp" wich has to write the name, date 
and filename to a database. And then redirects to the PDF file.
Before this, i could just write <a href="../<%= rsnaam("instrID")%
>">Link</a> to the page.
But here they asked me if it was possible to track wich person looks at 
wich file. Therefor i tried this.

The u-drive is a virtual-drive that i maked on my server.
It links to the files on an other server.
And the PDF files, work great when i just open then.
Only not when trying to use this application.

This is my bekijk.asp file.

id = request.form("id")
dim sql
sql = "SELECT insFileNaam FROM instructies WHERE instrID LIKE '"&ID&"';"
dim rs
set rs = server.CreateObject("ADODB.RecordSet")
rs.open sql, cnn1, 1,3

file = "../../u-drive/doc/" + rs("insFilenaam")

dim sq2
sq2 = "SELECT * FROM geraadpleegd"
dim rs2
set rs2 = server.CreateObject("ADODB.RecordSet")
rs2.open sq2, cnn1, 1,3
rs2.addnew
rs2("instrID") = request.form("id")
rs2("gebruiker") = session("user")
rs2("datum") = now()
rs2.update

response.redirect file


thnx

Vandael Tim
Message #2 by Spencer Saunders <spence@s...> on Fri, 26 Apr 2002 10:33:44 -0400
What browser are you checking this in? Or does this happen regardless of the
browser/ platform?

I had a similar problem a while ago but it was a strange intermitent problem
with MAC OS and uncompressed PDFs. In that case the file would read as
damaged when opened automatically (through a broswer) but would be fine if
opened from within Acrobat. I upgraded latest versions of the plug-ins etc.

It seemed to work. Have your PDF's ever been compressed as Stuffit archives?
- I only ask because that's what had happened in my case.


spence

on 4/26/02 1:35 PM, Vandael Tim at vandael_tim@h... wrote:

> Hey,
> 
> i am having a problem with displaying PDF files, when i am trying to
> display the PDF file, i get the "file is damaged and could not be
> repaired" message.
> 
> This is the code i use in my main-page.
> For each file, there is image with a form attached.
> 
> <form method="post" action="bekijk.asp">
> <td align="center" width="80">
> <input type=image src="images/bekijk.jpg">
> <input type="hidden" name="id" value="<%= rsnaam("instrID")%>">
> </td>
> </form>
> 
> The information is sent to "bekijk.asp" wich has to write the name, date
> and filename to a database. And then redirects to the PDF file.
> Before this, i could just write <a href="../<%= rsnaam("instrID")%
>> ">Link</a> to the page.
> But here they asked me if it was possible to track wich person looks at
> wich file. Therefor i tried this.
> 
> The u-drive is a virtual-drive that i maked on my server.
> It links to the files on an other server.
> And the PDF files, work great when i just open then.
> Only not when trying to use this application.
> 
> This is my bekijk.asp file.
> 
> id = request.form("id")
> dim sql
> sql = "SELECT insFileNaam FROM instructies WHERE instrID LIKE '"&ID&"';"
> dim rs
> set rs = server.CreateObject("ADODB.RecordSet")
> rs.open sql, cnn1, 1,3
> 
> file = "../../u-drive/doc/" + rs("insFilenaam")
> 
> dim sq2
> sq2 = "SELECT * FROM geraadpleegd"
> dim rs2
> set rs2 = server.CreateObject("ADODB.RecordSet")
> rs2.open sq2, cnn1, 1,3
> rs2.addnew
> rs2("instrID") = request.form("id")
> rs2("gebruiker") = session("user")
> rs2("datum") = now()
> rs2.update
> 
> response.redirect file
> 
> 
> thnx
> 
> Vandael Tim

Message #3 by "Vandael Tim" <vandael_tim@h...> on Tue, 30 Apr 2002 07:19:09
Hey,

the problem i have is under Internet Explorer.
The PDF's are not compressed or something like that.
I think it isnt a problem with the files, 
but that there is a problem with the "Response.Redirect File",
does anyone knows a solution?
I have a meeting this afternoon and it should work by then :-)
Or does anyone knows an other solution to open a PDF and keep track of 
those who are viewung the files?

thnx

greetz

Tim


> What browser are you checking this in? Or does this happen regardless of 
the
browser/ platform?

I had a similar problem a while ago but it was a strange intermitent 
problem
with MAC OS and uncompressed PDFs. In that case the file would read as
damaged when opened automatically (through a broswer) but would be fine if
opened from within Acrobat. I upgraded latest versions of the plug-ins etc.

It seemed to work. Have your PDF's ever been compressed as Stuffit 
archives?
- I only ask because that's what had happened in my case.


spence

on 4/26/02 1:35 PM, Vandael Tim at vandael_tim@h... wrote:

> Hey,
> 
> i am having a problem with displaying PDF files, when i am trying to
> display the PDF file, i get the "file is damaged and could not be
> repaired" message.
> 
> This is the code i use in my main-page.
> For each file, there is image with a form attached.
> 
> <form method="post" action="bekijk.asp">
> <td align="center" width="80">
> <input type=image src="images/bekijk.jpg">
> <input type="hidden" name="id" value="<%= rsnaam("instrID")%>">
> </td>
> </form>
> 
> The information is sent to "bekijk.asp" wich has to write the name, date
> and filename to a database. And then redirects to the PDF file.
> Before this, i could just write <a href="../<%= rsnaam("instrID")%
>> ">Link</a> to the page.
> But here they asked me if it was possible to track wich person looks at
> wich file. Therefor i tried this.
> 
> The u-drive is a virtual-drive that i maked on my server.
> It links to the files on an other server.
> And the PDF files, work great when i just open then.
> Only not when trying to use this application.
> 
> This is my bekijk.asp file.
> 
> id = request.form("id")
> dim sql
> sql = "SELECT insFileNaam FROM instructies WHERE instrID LIKE '"&ID&"';"
> dim rs
> set rs = server.CreateObject("ADODB.RecordSet")
> rs.open sql, cnn1, 1,3
> 
> file = "../../u-drive/doc/" + rs("insFilenaam")
> 
> dim sq2
> sq2 = "SELECT * FROM geraadpleegd"
> dim rs2
> set rs2 = server.CreateObject("ADODB.RecordSet")
> rs2.open sq2, cnn1, 1,3
> rs2.addnew
> rs2("instrID") = request.form("id")
> rs2("gebruiker") = session("user")
> rs2("datum") = now()
> rs2.update
> 
> response.redirect file
> 
> 
> thnx
> 
> Vandael Tim

Message #4 by "Vandael Tim" <vandael_tim@h...> on Tue, 30 Apr 2002 07:22:06
an other strange thing is, then when i press the "look" button,
i get the "file is damaged and could not be rapaired" message.
But when i press F5 (refresh) then. The PDF does load.
Strange if you ask me.

greetz

Vandael Tim


> Hey,

> the problem i have is under Internet Explorer.
T> he PDF's are not compressed or something like that.
I>  think it isnt a problem with the files, 
b> ut that there is a problem with the "Response.Redirect File",
d> oes anyone knows a solution?
I>  have a meeting this afternoon and it should work by then :-)
O> r does anyone knows an other solution to open a PDF and keep track of 
t> hose who are viewung the files?

> thnx

> greetz

> Tim

> 
>>  What browser are you checking this in? Or does this happen regardless 
of 
t> he
b> rowser/ platform?

> I had a similar problem a while ago but it was a strange intermitent 
p> roblem
w> ith MAC OS and uncompressed PDFs. In that case the file would read as
d> amaged when opened automatically (through a broswer) but would be fine 
if
o> pened from within Acrobat. I upgraded latest versions of the plug-ins 
etc.

> It seemed to work. Have your PDF's ever been compressed as Stuffit 
a> rchives?
->  I only ask because that's what had happened in my case.

> 
s> pence

> on 4/26/02 1:35 PM, Vandael Tim at vandael_tim@h... wrote:

> > Hey,
>>  
>>  i am having a problem with displaying PDF files, when i am trying to
>>  display the PDF file, i get the "file is damaged and could not be
>>  repaired" message.
>>  
>>  This is the code i use in my main-page.
>>  For each file, there is image with a form attached.
>>  
>>  <form method="post" action="bekijk.asp">
>>  <td align="center" width="80">
>>  <input type=image src="images/bekijk.jpg">
>>  <input type="hidden" name="id" value="<%= rsnaam("instrID")%>">
>>  </td>
>>  </form>
>>  
>>  The information is sent to "bekijk.asp" wich has to write the name, 
date
>>  and filename to a database. And then redirects to the PDF file.
>>  Before this, i could just write <a href="../<%= rsnaam("instrID")%
>> > ">Link</a> to the page.
>>  But here they asked me if it was possible to track wich person looks at
>>  wich file. Therefor i tried this.
>>  
>>  The u-drive is a virtual-drive that i maked on my server.
>>  It links to the files on an other server.
>>  And the PDF files, work great when i just open then.
>>  Only not when trying to use this application.
>>  
>>  This is my bekijk.asp file.
>>  
>>  id = request.form("id")
>>  dim sql
>>  sql = "SELECT insFileNaam FROM instructies WHERE instrID 
LIKE '"&ID&"';"
>>  dim rs
>>  set rs = server.CreateObject("ADODB.RecordSet")
>>  rs.open sql, cnn1, 1,3
>>  
>>  file = "../../u-drive/doc/" + rs("insFilenaam")
>>  
>>  dim sq2
>>  sq2 = "SELECT * FROM geraadpleegd"
>>  dim rs2
>>  set rs2 = server.CreateObject("ADODB.RecordSet")
>>  rs2.open sq2, cnn1, 1,3
>>  rs2.addnew
>>  rs2("instrID") = request.form("id")
>>  rs2("gebruiker") = session("user")
>>  rs2("datum") = now()
>>  rs2.update
>>  
>>  response.redirect file
>>  
>>  
>>  thnx
>>  
>>  Vandael Tim


  Return to Index