This project is read-only.

Images overwriting in posts

Topics: ASP.NET 2.0
Jun 8, 2014 at 7:22 PM
Hello, so I'm posting from my iphone and it seems to work great. The issue is when I post an image to a post and post it into overwrites all the images in all my posts. This seems to only happen from a mobile client.
Jun 9, 2014 at 8:10 PM
It appears when using the iphone/ipad, the images are uploaded as the following:
So every file I upload is getting that filename so it's overwriting the other files. Is there a way to remedy this?
Jun 9, 2014 at 8:35 PM
I'll check out later today if it works with latest code. We did have issues with uploads in Safari, not sure if it was resolved.
Jun 10, 2014 at 4:39 AM
Edited Jun 10, 2014 at 4:44 AM
Apparently in iOS every image passed to browser for upload with the same name (image.extension). I guess we'll have to add a time stamp if file name is "image.jpg" or "image.png". Not a pretty solution and have no idea why they doing it, but from few online threads seems that it is the case and this will fix the issue.
Jun 10, 2014 at 9:25 AM
Is there anything I can change to try and help? I can navigate through and edit some code if you want to try something. Also - and this is an iOS issue not a BE issue, you have to take photos sideways with your phone to show up correctly on a PC. This has shown up before in other threads particularly in those using the ghost blog platform
Jun 10, 2014 at 2:47 PM
Shouldn't be a huge deal, I"ll take care of it later tonight. Except taking photos sideways - that's up to you :)
Jun 10, 2014 at 4:08 PM
Great. I used the web PI to install BE so if there is a way to change the file of upload the new one to my existing installation I'll do that
Jun 11, 2014 at 3:15 PM
I've seen you've made some changes in your source doe and are now at How do I upgrade to the latest source code for my BE installation?
Jun 11, 2014 at 4:16 PM
If you on 2.9.1, you can modify /App_Code/Api/UploadController.cs where it posts images:
if (action == "image")
    if (Security.IsAuthorizedTo(Rights.EditOwnPosts))
        var fileName = new FileInfo(file.FileName).Name; // to work in IE and others
        // iOS sends all images as "image.jpg" or "image.png"
        fileName = fileName.Replace("image.jpg", DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".jpg");
        fileName = fileName.Replace("image.png", DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".png");

        var uploaded = BlogService.UploadFile(file.InputStream, fileName, dir, true);

        var filePath = uploaded.FileDownloadPath;
        filePath = filePath.Replace("image.jpg", DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".jpg");
        filePath = filePath.Replace("image.png", DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".png");

        return Request.CreateResponse(HttpStatusCode.Created, filePath);
I made a change to latest, but it is not committed yet.
Jun 11, 2014 at 6:33 PM
Great, I will make the change and test it out. Is there any plans to make or add an update component to BE? That way if new stuff is pushed out it can be down through the web interface?
Jun 11, 2014 at 6:34 PM
And if so how can I help?
Jun 11, 2014 at 10:38 PM
Mostly there, you can help testing it out by downloading version between and and running upgrade as described here.
Jun 12, 2014 at 3:13 AM
Thanks. I'll will give this a try. As I don't use FTP I will be using web deploy so I hope everything translates.
Jun 12, 2014 at 6:27 PM
Where is the 2.9 series downloads?
Jun 12, 2014 at 6:57 PM
Jun 13, 2014 at 1:51 AM
Downloaded the new source code and tried to compile. It builds okay and runs in IE but when I go to the admin dashboard I get the following
Could not load file or assembly 'WebGrease, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Jun 13, 2014 at 5:28 AM
Edited Jun 13, 2014 at 5:29 AM
There was issue with dependency after NuGet package update, please use this version ( It is older but works fine.
Jun 13, 2014 at 9:53 AM
Had the same problem, following worked for me(

In Visual Studio: Tools -> NuGet Package Manager -> Manage NuGet Packages for solution...
Then scroll down to WebGrease, select and click Manage.

Throws a couple of build errors, but seems to work.
Jun 13, 2014 at 12:01 PM
Seems to be errors when using the mssql config. Pages are showing up correctly in the
Admin dashboard. I'm also getting kicked out of it and it makes me log back in again. As for custom themes is t an available option, only extensions.

How do I get older versions? It seems the source only downlods the most recent
Jun 13, 2014 at 12:14 PM
Sorry, I see how to do it now. The sql web config and scripts say the database is for 3.0.0 not 2.9.
When "Downgrading" to the older version should the IOS images fix be applied from the code you supplied in the thread?
Jun 13, 2014 at 6:21 PM
Seems using the sql data provider with 2.9.37 doesn't work either. The admin dashboard errors out.
Jun 13, 2014 at 8:33 PM
On the newest version of BE this worked for me:

uninstall-package -f WebGrease

then install the previous version 1.5.1 using the following command
install-package WebGrease -Version 1.5.1
Jun 13, 2014 at 9:35 PM
Sorry I didn't keep track on this. There were few versions with error on deployment after package upgrade, it fixed and no need to re-fix it.
  • get compiled app from here, it is version and should work out of the box, no changes
  • run it as web app in WebMatrix or push to IIS as is, no need to do database etc.
  • go to dashboard and upgrade to latest
If you run into issues let me know. All we want is to make sure it works in as many environments as possible, so we can catch issues before release.
Jun 13, 2014 at 9:56 PM
Actually, just do the following:
uninstall-package -f WebGrease

then install the previous version 1.5.1 using the following command
install-package WebGrease

Then, if you try to publish you have the issue with microsoft.web.infrastructure
So once again:
uninstall-package -f microsoft.web.infrastructure
install-package microsoft.web.infrastructure

Then it published fine.
Jun 14, 2014 at 3:50 AM
Edited Jun 14, 2014 at 4:01 AM
Hello Rtur,
I'm getting the following error

Error 1 The file '/widgets/Tag cloud/widget.ascx' does not exist. ...\BlogEngine2.3.8\Custom\Widgets\Tag cloud\edit.ascx 2

I got it, fixed the path but I get JS errors now when trying to publish a post.