on 2019 Jun 27 4:26 AM
I am hosting a HTML file in Sybase 10 and it works so far good.
I want now to add img Tag in my HTML but it doesnt work, because img Tag expects a relative path to the img as "src".
Now the question is, what is the current folder for my webservice? I tried the path of dbsrv10.exe but without success "C:\\Program Files (x86)\\SQL Anywhere 10\\win32"
The script in DB looks something like:
create PROCEDURE hello_world( )
RESULT (html_doc long varchar)
BEGIN
CALL dbo.sa_set_http_header( 'Content-Type', 'text/html' );
select '<!DOCTYPE html>\\n'
|| '<html lang="en">\\n'
|| '<body>\\n'
|| 'hello world
\\n'
|| '<imgg srcc="010.jpg">\\n'
|| '</body>\\n'
|| '</html>\\n';
END;
create SERVICE hello_world TYPE 'RAW'
AUTHORIZATION OFF
USER DBA
AS CALL hello_world;
Request clarification before answering.
Hi Sarkis,
maybe this sample helps: https://www.db-tecknowledgy.info/fileshare/public/SQLAnyIcon.SQL
I provide the Image binary as a service. In case you want images from multiple or large server side files, you can utilize xp_read_file rather than specifying the binary content literally.
The logic around provides a framework and sample for a root service listing the available "open" services in the DB, with the SQL Anywhere product icon as favicon. I just verified that it runs against v.17, but I'm quite sure that I used it with older versions in the past.
HTH
Volker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you all. I found a good solution using IIS, so I added a virtual directory in IIS and then used the full URL in my HTML to access each photo from this virtual directory.
Something like: <imgg srcc="http://my_ip/my_directory/111.jpg">
I write imgg instead of img and srcc instead of src in order to avoid HTML interpreting on this page.
User | Count |
---|---|
50 | |
10 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.