upload .JPG FIX!

  •  06-01-2005, 12:35 PM

    upload .JPG FIX!

    Hi Adam,
    I'm not for sure if you have a fix for the .JPG uploader issue where the file extension is in upper case, but I have a very simple fix. Now keep in mind that this is for version 3.0 only. I don't know about version 4.0.
     
    Within the <head> </head> section of the file insert_image.asp there is a bit of javascript that looks like this:
    ...Old way
     
     function insert_Image()
     {  
      var sHTML = '<img'
        + attr("src", imgname.value)
        + attr("alt", AlternateText.value)
        + attr("align", Align.value)
        + ((Width.value)  ? attr("width" , Width.value)  : "")
        + ((Height.value) ? attr("height", Height.value) : "")
        + ((VSpace.value) ? attr("vspace", VSpace.value) : "")
        + ((HSpace.value) ? attr("hspace", HSpace.value) : "")
        + ((Border.value) ? attr("border", Border.value) : attr("border",0))    
        + ((bordercolor.value&&(Border.value > 0)) ? attr("style", "border-color="+bordercolor.value) : "")
        + '/>';
      
      window.returnValue = sHTML;
      window.close();


    I changed it to this:

    ...New way

     function insert_Image()
     {  
      var sHTML = '<img'
        + attr("src", imgname.value.toLowerCase())    // added the lower case command
        + attr("alt", AlternateText.value)
        + attr("align", Align.value)
        + ((Width.value)  ? attr("width" , Width.value)  : "")
        + ((Height.value) ? attr("height", Height.value) : "")
        + ((VSpace.value) ? attr("vspace", VSpace.value) : "")
        + ((HSpace.value) ? attr("hspace", HSpace.value) : "")
        + ((Border.value) ? attr("border", Border.value) : attr("border",0))    
        + ((bordercolor.value&&(Border.value > 0)) ? attr("style", "border-color="+bordercolor.value) : "")
        + '/>';
      
      window.returnValue = sHTML;
      window.close();

    This changes the code to lower case and is inserted into the html code by the CuteSoft editor.  The actual jpeg that is uploaded is still upper case and doesn't change.
     
    Hope this can help someone.
    bvo
View Complete Thread