Print Page | Close Window

Changing the image path

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=12119
Printed Date: 09 April 2026 at 8:32am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Changing the image path
Posted By: Alski
Subject: Changing the image path
Date 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 - 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 - 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




Replies:
Posted By: WebWiz-Bruce
Date 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.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Alski
Date 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




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net