Using Backload to upload image to project file but images do not appear until project is rebuilt

265 Views Asked by At

Using MVC 4 I downloaded Blackcity Backload from nuget, I am trying to save the uploaded images to a file that is within my project. Everything works great and it shows that the image uploaded, except for the fact that after you upload a new image, and refresh the page the image does not appear in the list of returned images even though it was saved. Also if you delete a file it comes off the list at first but again if you refresh the page it is back. If you rebuild the application then everything appears as it should and the images in the backload file list are all listed correctly and they match what is in the actual file.

I thought it may be a server cache issue but I did all i can to prevent the server from caching and still same problem.

I think it may have to do with the fact that Backloader is dynamically creating folders to put the images in and they are not included in the project even though they are in the file structure. So since they are not part of the project they are not being returned in the get request. Its not until you rebuild that they are recognized as part of the project.

Is there a way to dynamically include new files in the project without rebuilding?

Please help. This is killing me.

1

There are 1 best solutions below

0
On

Ok this is solved. Had to remove filters.Add(new AuthorizeAttribute()) from my global filters and then add [Authorize] to each controller and it worked.