some problems with asp.net and asp

 
Post new topic   Reply to topic    Aprelium Forum Index -> ASP.NET
View previous topic :: View next topic  
Author Message
scorpion
-


Joined: 07 Dec 2006
Posts: 5

PostPosted: Thu Dec 07, 2006 4:43 pm    Post subject: some problems with asp.net and asp Reply with quote

hi
i wanted to thank you for this great software.
i have downloaded x1 and had a short exprience with it .
i am a professional programmer , i had IIS server with windows xp professional installed and had multiple website running in my computer with asp and asp.net .
i wanted my customer to see and check his website anytime on my compute r, i had some problems with iis , for limited connection number that was very bad so i switched to abyss x1 for solving this i ran my web site almost easily excpet the following problems :
1- my forum software is free WEB WIZ forum that is written with asp , but i couldn't run it and activehtml is not free is another free software for running asp applications ?
2- i have a script that creates thumbnails on the fly for first time and after that just redirects request to previous ly generated file .
it gave me erroe because i use server.mappath in it how ir can be solved ?
3- i solved temporarily with setting a variable to physical root path and use to solve the problem and it seemed solved but when having multiple images referring to this script on a page , it some times shows all of them some times shows only some od them !
and it changes every time i refresh on my browser ! shows some other pictures and for the others shows error !
what is this problem and how can be solved ?
4- is there any tunning parameters to tuning and caching files or not and where can i find information about them .
thnx again and please help me
Back to top View user's profile Send private message Send e-mail
scorpion
-


Joined: 07 Dec 2006
Posts: 5

PostPosted: Thu Dec 07, 2006 4:44 pm    Post subject: here is the source code Reply with quote

Partial Class GetImage
Inherits System.Web.UI.Page
Dim tmpImg As System.Drawing.Image
Dim Image As String

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Image = Request.QueryString("Image")
If Image = String.Empty Then
Image = "\emdad\images\NoPhoto.jpg"
Response.Redirect(Image)
End If

Dim sSize = Request("Size")
Dim Size As Integer = 60

If Not sSize = String.Empty Then
Size = Int32.Parse(sSize)
End If

Dim Path As String = Server.MapPath(Request.ApplicationPath + "\" + System.IO.Path.GetDirectoryName(Image)) + "\sm" + System.IO.Path.GetFileName(Image)
Dim ReDirectPath As String = System.IO.Path.GetDirectoryName(Image) + "\sm" + System.IO.Path.GetFileName(Image)
'Response.Write(System.IO.Path.GetDirectoryName(Image) & "<BR>")
'Response.Write(System.IO.Path.GetFileName(Image) & "<BR>")
'Response.Write(ReDirectPath & "<BR>")
Try
If Not System.IO.File.Exists(Path) Then
Path = Server.MapPath(Request.ApplicationPath + "\" + Image)
tmpImg = Drawing.Image.FromFile(Path)
tmpImg = tmpImg.GetThumbnailImage(Size, tmpImg.Height / (tmpImg.Width / Size), Nothing, 0)
Path = Server.MapPath(Request.ApplicationPath + "\" + System.IO.Path.GetDirectoryName(Image)) + "\sm" + System.IO.Path.GetFileName(Image)
tmpImg.Save(Path, System.Drawing.Imaging.ImageFormat.Jpeg)
tmpImg.Dispose()
End If
Catch ex As Exception
ReDirectPath = "../Images/NoPhoto.jpg"
Finally
Response.Redirect(ReDirectPath)
End Try
End Sub
End Class
Back to top View user's profile Send private message Send e-mail
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Dec 08, 2006 1:05 pm    Post subject: Re: some problems with asp.net and asp Reply with quote

scorpion wrote:
1- my forum software is free WEB WIZ forum that is written with asp , but i couldn't run it and activehtml is not free is another free software for running asp applications ?


If there were other solutions we'd cited them. Unfortunately, ActiveHTML is the only independant ASP interpreter available today. Note that you can still use the last free version of ActiveHTML which is available from http://www.aprelium.com/forum/viewtopic.php?t=8874 .

scorpion wrote:
2- i have a script that creates thumbnails on the fly for first time and after that just redirects request to previous ly generated file .
it gave me erroe because i use server.mappath in it how ir can be solved ?


What was the error you got? Was it an error or was the output of mappath not as it should have been? By the way, we noted in your code that you use backslashes in mappath parameter, this is likely to cause problems because the path separator in a web URL is / and not \.

Quote:
3- i solved temporarily with setting a variable to physical root path and use to solve the problem and it seemed solved but when having multiple images referring to this script on a page , it some times shows all of them some times shows only some od them !
and it changes every time i refresh on my browser ! shows some other pictures and for the others shows error !
what is this problem and how can be solved ?


All depends on the error that is shown. What is it? Try also checking the access.log file when doing your tests to verify that it is actually the server who is sending these images and not the browser displaying old images from its cache.

Quote:
4- is there any tunning parameters to tuning and caching files or not and where can i find information about them .
thnx again and please help me


Abyss Web Server does not cache files or dynamic scripts output. But browsers can do that. So you'll have to explicitly output some extra HTTP headers to instruct browsers to not cache the current file/request result. If you're using ASP.NET, this should be configurable in Web.config (and ASP.NET will then output the HTTP headers for you): http://www.google.com/q=caching+in+ASP.NET .
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
scorpion
-


Joined: 07 Dec 2006
Posts: 5

PostPosted: Fri Dec 08, 2006 6:20 pm    Post subject: / or \ Reply with quote

i changed \ to / and it didn't sole the problem it gives me the foloowing error :
Server Error in '/emdad/fa' Application.
Failed to map the path '/emdad/images/news'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Failed to map the path '/emdad/images/news'.

Source Error:

Line 19: End If Line 20: Line 21: Dim Path As String = Server.MapPath(Request.ApplicationPath + "/" + System.IO.Path.GetDirectoryName(Image)) + "/sm" + System.IO.Path.GetFileName(Image) Line 22: Dim ReDirectPath As String = System.IO.Path.GetDirectoryName(Image) + "/sm" + System.IO.Path.GetFileName(Image) Line 23: 'Response.Write(System.IO.Path.GetDirectoryName(Image) & "<BR>")


Source File: C:\Emdad\Fa\GetImage.aspx.vb Line: 21

Stack Trace:

[InvalidOperationException: Failed to map the path '/emdad/images/news'.] System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +615 System.Web.VirtualPath.MapPathInternal() +29 System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping) +122 System.Web.HttpServerUtility.MapPath(String path) +58 GetImage.Page_Load(Object sender, EventArgs e) in C:\Emdad\Fa\GetImage.aspx.vb:21 System.Web.UI.Control.OnLoad(EventArgs e) +80 System.Web.UI.Control.LoadRecursive() +49 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3716


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Back to top View user's profile Send private message Send e-mail
scorpion
-


Joined: 07 Dec 2006
Posts: 5

PostPosted: Fri Dec 08, 2006 6:32 pm    Post subject: hi Reply with quote

for problems in showing only some of pictures i checked the access.log and i saw that some pictures that must be returned from that script , were returned with error 500 which i think is access forbidden . maybe a bandwidth limit or something like this causes this problem , can you help me in that ?
Back to top View user's profile Send private message Send e-mail
scorpion
-


Joined: 07 Dec 2006
Posts: 5

PostPosted: Fri Dec 08, 2006 6:36 pm    Post subject: i think i solved last problem Reply with quote

i disabled cache negotiation for my sub applications and problem seems solved .
Back to top View user's profile Send private message Send e-mail
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Dec 09, 2006 2:54 pm    Post subject: Re: / or \ Reply with quote

scorpion,

The Servermap error needs further investigation. Could you please send your abyss.conf file to support@aprelium.com (please put in your email a reference to this forum thread)?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> ASP.NET All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group