Problemer med thumbnails
Jeg har fundet denne funktion til at lave thumbnails on the fly.<%@ Page Language="vb" Debug="True" %>
<%@ import namespace="System" %>
<%@ import namespace="System.Drawing" %>
<%@ import namespace="System.Drawing.Imaging" %>
<%@ import namespace="System.IO" %>
<script runat="server">
Sub CreateThumb()
dim graphic as System.Drawing.Image = System.Drawing.Image.FromFile(request("Image"))
dim graphicFormat = graphic.rawformat
dim Image as New Bitmap(graphic, cint(request("Width")), cint(request("Height")))
if graphicFormat.Equals(System.Drawing.Imaging.ImageFormat.Gif) then
Response.ContentType = "image/gif"
elseif graphicFormat.Equals(System.Drawing.Imaging.ImageFormat.Jpeg) then
Response.ContentType = "image/jpeg"
elseif graphicFormat.Equals(System.Drawing.Imaging.ImageFormat.Png) then
Response.ContentType = "image/png"
elseif graphicFormat.Equals(System.Drawing.Imaging.ImageFormat.Bmp) then
Response.ContentType = "image/bmp"
end if
Image.Save(Response.OutputStream, graphicFormat)
graphic.Dispose()
Image.Dispose()
End Sub
</script>
<% CreateThumb() %>
Problemet op står (så vidt jeg kan se) når jeg giver den et billede navn med æ,ø eller å
F.eks:
http://lachica.dk/ASPNetThumb.aspx?Image=C:\W3Sites\lachica\www\varer_pic\sæt.a3.jpg&Width=222&Height=165&Compression=2
Så fjerner den simpelthen æ, så jeg får denne fejlmeddelelse:
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.IO.FileNotFoundException: C:\W3Sites\lachica\www\varer_pic\st.a3.jpg
