Unable to insert images in page editor...

Jun 7, 2013 at 8:09 PM
Edited Jun 8, 2013 at 1:06 AM
I am currently using the latest 2.8.0.1 version. I believe I have the proper read/write permissions on the App_Data folder. I am able to upload image files into the App_Data/files/2013/06 directory using the File Manager. Unfortunately, the images do not show in the page I am inserting the images into.

When I right mouse click on the image in the editor and select Insert/Edit Image, the path to the image file shows /IMAGES%2f2013%2f06%2fImageFile.png.jpgx - this confuses me because the path under App_Data starts with "files" and not "IMAGES".

I am hosting this on a Windows 2003 Server SP2 using IIS 6.

I have included a screen shot below for your review. Any help would be greatly appreciated.

Thanks!

Image
Jun 8, 2013 at 1:01 AM
Edited Jun 8, 2013 at 1:02 AM
Try inserting an image instead of uploading it with the file manager, I am using 2.8.0.1 here and have inserted several images in sever posts without any issue. The issue that I am having along thee line is after attaching a PDF file to a page when clicked on it does not opes as with 2.5 but downloads it instead. Also I have found that with 2.8.0.1 if the file has a space in the filename it does not work.
Jun 8, 2013 at 1:27 AM
Hello jerrysdean43, Thank you for the response...

I reviewed your site (very nice by the way...I love hiking). I noticed that the URL to your images were formatted in the following manner:

/image.axd?picture=%2f2013%2f06%2fLemmon+Rocks+1.jpg

My images are formatted differently as in the following:

/IMAGES%2f2013%2f06%2fMinutemanLogoNormal2.png.jpgx

My format does not include the "/image.axd?picture=" that your formatting includes. In addition, my formatting appends a ".jpgx" extension on the end.

Any ideas or resolution would be incredibly appreciated.

Finally, when you responded earlier, the image in my original post was not functioning. It is now there for your review.

Once again...Thanks!
Jun 8, 2013 at 2:03 AM
Edited Jun 8, 2013 at 2:05 AM
I apologize, I just realized that the images in the posts were inserted when I was running 2.5. Any ideas on why the PDF's don't open and download instead. Check this page notice the different file names on the May and April files and the difference in the way they function. The April file was with 2.5 and May was inserted with 2.8.

Thanks.
Jun 8, 2013 at 3:15 AM
Edited Jun 8, 2013 at 5:25 AM
Help...Anyone! Sorry, jerrysdean43, I do not know how to resolve your pdf problem. I will look into it as soon as my image problem is resolved.

Please...there seems to be several individuals that have experienced my problem and there does not seem to be any clear resolution. If I edit the path and remove the "IMAGES" text and replace it with "image.axd?picture=" and delete the ".jpgx" at the end of my image URL, then the image appears correctly.

I found one discussion:287465 on this forum that seems to resolve this problem back in May of 2012 by editing the BlogEngine.Core/FileSystem/image.cs. In that post the code was modified to look like the following:
     public string ImageUrl
     {
         get
         {
              return string.Format("{0}image.axd?picture={1}", Utils.RelativeWebRoot,, this.SafeFilePath);
          }
      }
I have not downloaded the source code version. Is there a way to accomplish the above resolution by editing an existing file, or do I have to download, edit and install the source code version? Please advise...

Thank you once again!
Jun 8, 2013 at 4:21 AM
I just inserted an image in this post and it worked fine. Path looks like this:
<p><img src="/image.axd?picture=%2f2013%2f06%2f22527448_BG1.JPG" alt="" /></p>
Jun 8, 2013 at 5:35 AM
Edited Jun 8, 2013 at 5:48 AM
I have resolved the problem by downloading the source code and editing the BlogEngine.Core/FileSystem/image.cs file.

The original looked like this:
        /// <summary>
        /// gets the full download path to the file, using the file handler
        /// </summary>
        public string ImageUrl
        {
            get
            {
                return string.Format("{0}IMAGES{1}.jpgx", Utils.RelativeWebRoot, this.SafeFilePath);
            }
        }
I modified it to look like this...
        /// <summary>
        /// gets the full download path to the file, using the file handler
        /// </summary>
        public string ImageUrl
        {
            get
            {
                return string.Format("{0}image.axd?picture={1}", Utils.RelativeWebRoot, this.SafeFilePath);
            }
        }
I then recompiled the source which generated the following files in the BlogEngine.NET/Bin folder...

BlogEngine.Core.dll
BlogEngine.Core.pdb
BlogEngine.Core.XML

I then merely copied these files to the /Bin directory on the web server replacing the original files...all is now working just fine! The image URL's are now functioning properly. I hope this helps others in resolving a similar problem. Good luck!
Jun 8, 2013 at 7:22 AM
@jerrysdean43...I inserted an Adobe pdf file into one of my pages and I was not able to open the pdf. After looking at the URL to the file, it looked very similar to the problem I was having with the images. I have resolved the problem in the following way, and I believe this will solve your problem as well...

I used Visual Studio 2010 to open the BlogEngine 2.8 source code and edited the BlogEngine.Core/FileSystem/File.cs file. I modified the following code:
        /// <summary>
        /// gets the full download path to the file, using the file handler
        /// </summary>
        public string FileDownloadPath
        {
            get
            {
                return string.Format("{0}FILES{1}.axdx", Utils.RelativeWebRoot, this.SafeFilePath);
            }
        }
I changed the code above to the following:
        /// <summary>
        /// gets the full download path to the file, using the file handler
        /// </summary>
        public string FileDownloadPath
        {
            get
            {
                return string.Format("{0}file.axd?file={1}", Utils.RelativeWebRoot, this.SafeFilePath);
            }
        }
I then recompiled the code which created the following .dll, .pdb and .XML files in the BlogEngine.NET/Bin folder in the development environment:

BlogEngine.Core.dll
BlogEngine.Core.pdb
BlogEngine.Core.XML

I then simply copied these files to the production server in the /Bin directory and replaced the existing files with the same name. The files now will work as expected! Good Luck!!!
Jun 8, 2013 at 6:05 PM
Edited Jun 8, 2013 at 6:09 PM
Hi All... After further review, although I did not test this, I believe that I may have only needed to replace the BlogEngine.Core.dll file and not the others. I am not sure of this because I did not test this. IMPORTANT: My recommendation would be to save the original files in the event you have adverse results...this is a prudent practice in any case. I replaced these three files on a completely new installation and therefore any data or information loss may not have been detectable.
Jun 9, 2013 at 8:55 PM
Thanks for your help. I am not having any issues inserting images in a new post using 2.8.0.1, not sure why it works for me so I don't need to change anything.