Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Changing the image path
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Changing the image path

 Post Reply Post Reply
Author
Alski View Drop Down
Newbie
Newbie


Joined: 11 October 2004
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alski Quote  Post ReplyReply Direct Link To This Post Topic: Changing the image path
    Posted: 11 October 2004 at 12:47am

Hi,

I am able to upload images with no problems to:

http://www.mydomain/files/mydomain/admin/foobar.gif 

The folder my hosts have set up with RWD permissions is "files" and so this is correct and uploads correctly.  However, the image doesn't display on the forum at all as it outside of my "sites" folder.

But my hosts (ASPwebhosting) have created a "virtual directory call" so that http://www.mydomain/files/admin/foobar.gif works fine.

I notice that the Message field in the tblThread table contains the top url structure, but I need to alter it to the lower url structure, preferably before it get's entered into the database.

I'm using the Persits AspUpload component.

Is it functions_upload.asp or upload_images.asp I need to alter?

Cheers,
Al

Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 11 October 2004 at 3:57am
The forum code tries to enter a relative path, but allot of browser like IE automactically change the path to the full URL.

This means that you would need to change the behaviour of the browser, which would not be possiable.
Back to Top
Alski View Drop Down
Newbie
Newbie


Joined: 11 October 2004
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alski Quote  Post ReplyReply Direct Link To This Post Posted: 11 October 2004 at 1:18pm

Hi,

I actually get an identical problem using Netscape.  The problem is not the hard coding (although it might be if I migrate servers), it's the directory structure my hosts have set up.

This may only affect ASPWebhosting customers.

I think I've got two options:

i) change the link code BEFORE it get's entered into the Message field, or,

ii) change the body of the message before it gets served with a Replace function

What I've now (partially) done is the latter:

In forum_posts.asp I've added two lines where line 782 was:

'this next line adjusts the image code so that it works in ASPwebhosting's virtual directory call
strMessage = Replace(strMessage,"files/mydomain","files")

so when the page is served, the correct code needed for my hosts is used and the image displayed

I've also adjusted post_preview.asp so that at line 148 it now reads:

<%
'this next line adjusts the image code so that it works in ASPwebhosting's virtual directory call
strMessage = Replace(strMessage,"files/mydomain","files")
%>

So that people can see the image in their preview also.

What I still need to work out how to do is replace the paths in both the edit_post.asp and again in the forum_posts.asp files so that the images are displayed as the posts are being edited or written.

Cheers,
Ali

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.