Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
the following works fine on local machine but did not work on live server


VB
Protected Overridable Sub qrCodeImage_Changed(ByVal sender As System.Object) Handles Me.OnQRCodeImageChanged
        'Dim strImageOriginal As String = strGuid.ToString() + strImageSize
        Dim id As String = Guid.NewGuid.ToString
        Dim strImageOriginal As String
        Select Case Request.Cookies("Tab_Name").Value.ToString
            Case "vcard"
                strImageOriginal = "Vcard_" & txt_firstname.Text & "_" & txt_lastname.Text
            Case "event"
                strImageOriginal = "EVent_" & Regex.Replace(txtEvent.Text, "[\[\]\\\^\$\.\|\?\*\+\(\)\{\}%,;><!@#&\-\+\/\:]", "").Replace("http", "").Replace("www", "").Split(" ")(0)
            Case "qrFlikr"
                strImageOriginal = Directory.GetFiles(Server.MapPath("QRflikr"), "*.*").Length.ToString & "_" & Guid.NewGuid.ToString
            Case Else
                strImageOriginal = Regex.Replace(s, "[\[\]\\\^\$\.\|\?\*\+\(\)\{\}%,;><!@#&\-\+\/\:]", "").Replace("http", "").Replace("www", "").Split(" ")(0)
        End Select
        ImageQrCode.Save(Server.MapPath("QRImages/" + strImageOriginal + id + ".png"), System.Drawing.Imaging.ImageFormat.Png)
        ImageQrCode.Dispose()
        If Not Request.Cookies("overlay").Value = "" And Not Request.Cookies("overlay").Value = "''" Then
            ImageButton1.ImageUrl = ""
            Dim picBackground As Image = Image.FromFile(Server.MapPath(Request.Cookies("overlay").Value))
            Dim picForeground As Image = Image.FromFile(Server.MapPath("QRImages/" + strImageOriginal + id + ".png"))
            Dim finalimage As Image = OverlayImages(picForeground, picBackground)
            picBackground.Dispose()
            picForeground.Dispose()
            finalimage.Save(Server.MapPath("QRImages/" + strImageOriginal + id + ".png"))
            ImageButton1.ImageUrl = "QRImages/" + strImageOriginal + id + ".png"
        Else
            ImageButton1.ImageUrl = "QRImages/" + strImageOriginal + id + ".png"
        End If
    End Sub
Posted
Comments
Ron Beyer 3-Sep-13 3:36am    
What does OverlayImages do? Can you post the code for that? What line do you get the error on?

1. Tell us line where error occurs (for this u have to create log file)
2. Also check folder created on server should have rights to create/save files
 
Share this answer
 
Comments
sallaudin 3-Sep-13 5:04am    
i have submitted ther log please help me out on this
2013-09-03 13:03:55,038 [18] ERROR Generator - strUrl about to execute
2013-09-03 13:03:55,114 [18] ERROR Generator - save image about to execute
2013-09-03 13:03:55,116 [18] ERROR Generator - exception occurred
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at Generator.qrCodeImage_Changed(Object sender)
at Generator.generateqrcode(String text)

the log created and the folder has the permissions to create/save files
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900