Exporting PDF from DB

Post Reply
greenwoo
Posts: 4
Joined: Wed Sep 21, 2005 8:25 am

Exporting PDF from DB

Post by greenwoo »

HI,
I'm uploading pdf files into my data base.

<FORM ACTION="FKC_ADMIN_QUERIES" NAME="searchform" METHOD="POST" ENCTYPE="multipart/form-data">
....
<INPUT TYPE=FILE Name=ATTACHMENT size=30 class="formcreate">
....
</FORM>

In the db queries script I set a temp dump folder and passe the files there renaming them

<rand 100000 999999>
<sum "%s" "e:\data\dump\ALEX\" $USER $TYPE $ret "." pdf >
<$OUT = $ret>
<WRITE $OUT>
<fmt "%s" $ATTACHMENT>
</WRITE>

I then insert it into the data base. I can view the raw data in the table.

My question is how do I call it back into a browser in a pdf format.

I've tryed this but doesn't seem to work

I do an sql query. It ouputs the data!

<SQL MAX=1 ROW "SELECT TITLE, ATTACHMENT FROM FKCDATA WHERE id=$id;">

Call a link called fulledit.pdf that is function below

<A HREF="./fulledit.pdf">$TITLE</A>

Create the function

<a name=fulledit PUBLIC>
<SQL MAX=1 ROW "select id, ACTIVITY, ATTACHMENT from FKCDATA where id = $id">
<fmt "%s" $ATTACHMENT>
</SQL>
</a>

This is the error message I'm getting

Texis
was unable to process the requested URL:
http://10.9.35.103/cgi-bin/texis.exe/ts ... lledit.pdf

Please ask the site administrator of <B>10.9.35.103</B> to check
vortex.log for problems.

<!-- 2 /tscript/fkc/tests:0: Can't open source file: Permission denied in the function: () -->
Status: 500 Script not found or Vortex error

Many Thanks

Alex
User avatar
Kai
Site Admin
Posts: 1271
Joined: Tue Apr 25, 2000 1:27 pm

Exporting PDF from DB

Post by Kai »

texis.exe runs as the CGI user when run from the web; for IIS that is usually IUSR or some variant. Make sure that user (or Everyone) has full control to the directory where your script(s) are, so that texis.exe can read the source, and write the .vtx file.
Post Reply