CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Opening pdf file from database column link

Print topic Send  topic

Author Message
fuzfuad

Posts: 7
Posted: 08/31/2007, 3:21 AM

Hi,

I wonder if anyone has done this before.

I store a report path in a column in my DB table. I use a grid to display the records from the table and the report path column is made as a link that should read the path and open the pdf file. The link control used is for a form and not for html. I have put the preserve parameters to POST so that any query strings are not attached to the http. When the cursor is on the link field, you can see that it has the right path; however, it doesn't open the file. I get a message 'File not found'. But if I change the link to hyperlink (from html), and type in the path instead of reading it from the DB, the file opens.

I hope someone can enlighten me on this issue. I need to solve this problem urgently.

Thanks.

Fuz
View profile  Send private message
wkempees


Posts: 1679
Posted: 09/01/2007, 7:22 AM

The value retreived from database is pdf filename.
However, you link is linking to the filename retreived, you need to add the relative path.
At least this is what I deduct from your post.
Upon retreival of the databasefield, add the path to it.

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
fuzfuad

Posts: 7
Posted: 09/03/2007, 1:32 AM

Hi,

I have tried your suggestion but I put the path in the database column. This way, in the future, those who will be mantaining this system can just specify the files in the db rather than amending the code. The problem is solved now.

Thanks.

Fuz
View profile  Send private message
wkempees
Posted: 09/03/2007, 2:02 AM

Glad to see you solved it.
By putting the path in the DB, you may have created an easy way for your
users.
You may have made it harder on yourself though, if you ever need to relocate
the application (other domain, other server paths) you will have to go
throught the database using SQL to change all paths.

I would suggest you have a look at you applications source code, there are
globals (variables) containing the 'root' path, or you might even introduce
a systems table conatining sme of these global fields and concatenate these
with you file_fields.
For future use only.

Greetz,
Walter


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.