COM+ & asp: image location problem
Posted: 2009-03-19T02:43:09-07:00
Hi
I have a small sub which resizes an uploaded picture to max 210x210.
when i provide the image location in a logic way, it works without any problem
for example:
Resize = Img.Convert("convert:","-resize","210x","d:/inetpub/wwwroot/WEBSITE/content/ProductInformation/" + IdtArticle + ".jpg", "d:/inetpub/wwwroot/WEBSITE/content/ProductInformation/" + IdtArticle + ".jpg")
but i'm programming this function, so it works on each site.
sometimes the inetpub is on the c-drive. and the website-name is each time a different name.
so i would need relative image locations as follow:
\content\productinformation?
../../content/productinformation?
my page where i do the upload is in the root of the website (inetpub/wwwroot/WEBSITE/)
the include file where my function is saved, has following location (inetpub/wwwroot/WEBSITE/scriptlibrary)
I searched this inquiry on internet, but can only find examples with the logic location.
Could somebody please help me out?
Thanks in advance
Sub ResizeFoto (IdtArticle)
' Variable declaration
Dim Img
Dim Resize
' Functionality
Set Img = Server.CreateObject("ImageMagickObject.MagickImage.1")
Resize = Img.Convert("convert:","-resize","210x","/content/ProductInformation/" + IdtArticle + ".jpg", _
"/content/ProductInformation/" + IdtArticle + ".jpg")
Set Img = Nothing
Set Resize = Nothing
End Sub ' of ResizeFoto
I have a small sub which resizes an uploaded picture to max 210x210.
when i provide the image location in a logic way, it works without any problem
for example:
Resize = Img.Convert("convert:","-resize","210x","d:/inetpub/wwwroot/WEBSITE/content/ProductInformation/" + IdtArticle + ".jpg", "d:/inetpub/wwwroot/WEBSITE/content/ProductInformation/" + IdtArticle + ".jpg")
but i'm programming this function, so it works on each site.
sometimes the inetpub is on the c-drive. and the website-name is each time a different name.
so i would need relative image locations as follow:
\content\productinformation?
../../content/productinformation?
my page where i do the upload is in the root of the website (inetpub/wwwroot/WEBSITE/)
the include file where my function is saved, has following location (inetpub/wwwroot/WEBSITE/scriptlibrary)
I searched this inquiry on internet, but can only find examples with the logic location.
Could somebody please help me out?
Thanks in advance
Sub ResizeFoto (IdtArticle)
' Variable declaration
Dim Img
Dim Resize
' Functionality
Set Img = Server.CreateObject("ImageMagickObject.MagickImage.1")
Resize = Img.Convert("convert:","-resize","210x","/content/ProductInformation/" + IdtArticle + ".jpg", _
"/content/ProductInformation/" + IdtArticle + ".jpg")
Set Img = Nothing
Set Resize = Nothing
End Sub ' of ResizeFoto