Using Backload to upload image to project file but images do not appear until project is rebuilt - asp.net-mvc

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.

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.

Related

CN1 - unable to use localization after activating css

Recently I switched over from the legacy css integration to using the current method of css support via the CN1 Preferences dialog. Ever since then, I've had repeated problems accessing strings from the localization resource file.
A few important points:
I have two theme files, but even importing the strings as a csv file into the theme generated by css doesn't work
I've tried all possible combinations of theme initialization with the two theme files, including initializing just one of them, with no consistent success (occasionally it works, but then if I modify the css and the theme file gets regenerated it stops working again)
I created a brand new project and copied my code into it, imported the string files, and it worked - until I turned on css support. Then I was back to square one
When it fails to work, the method UIManager.getL10NResourceNames() returns an empty array
Any help would be greatly appreciated!
CSS controls the file and as a result you can no longer change the theme.res file by other means. You need to keep a separate localization.res file and load that strictly for the localization functionality of your application. You can use Resources.open("/localization.res") to load an arbitrary resource file.
After much poking around, I found the solution. It turns out my situation was the result of a few non-standard things I did. First of all, I had a theme.res file which I renamed using IntelliJ's Refactor >> Rename function, which renamed the hardcoded css theme name in the build.xml file to my new name. I needed to manually revert that string in order to prevent the css compile task from overwriting my theme file. The second thing I noticed is that sometimes (I'm not clear on what caused this) the theme file was not being refreshed in the /out directory when running the app locally. This would manifest itself, for instance, when I would add an image in the theme file, but when running the code it wouldn't be able to find it in the Resources hashtable. Every time this happens, I now know to just delete the contents of /out, thereby forcing the IDE to rebuild/recopy the theme file (I could probably just copy it manually to the /out directory, but I think deleting it is safest).

Uploaded image can't be saved in to folder and the image can't be view in folder when running web under IIS

I have project to upload image and view image on asp.net. everything work as i expected. i can upload image and saved to my folder then saved the folder to database, then from database i can show or view the image.
Unfortunately, after publishing to IIS and run the web UNDER IIS , image that i uploaded won't saved to folder and also the image that contains on my folder can't be viewed when running web under IIIS.
I tried to search in stackoverflow how to solve it and everyone said it's about permission i have tried option to set the security permission but nothing works
Folder settings:
Subfolder settings:
I suspect it could be perhaps a wrong path as your app is installed under the default web site... I often suggest to alwyAs start from the exact thing that happens to avoid guessing about issues.
Edit: the folder structure is really strange. It seems I have the default web site, created an application root under this web site but your main ScraBoy app volder is still under this folder ??? I believe I installed app one level below what you intended

Media folder not showing images in Umbraco

I have migrated a umbraco site over. Hooked the databse up and everything is working fine but the images are not showing on the site and in the media folder.
I have set the permissions on the folder.
changed authentication on the folder to app pool.
tried changing virtualRoot to rootPath and rootUrl.
none of the above work. The files names are showing in the media window but no images (blank previews).
Funny thing is i can upload images now and there are showing so something to do with path.
hope someone can help. thanks
Perhaps you need to tell Umbraco that it's running in a virtual directory.
There is a setting in the umbracoSettings.config which you can read about here: https://our.umbraco.org/documentation/reference/config/umbracosettings/#notifications (search for ResolveUrlsFromTextString)
Set the following to true:
<ResolveUrlsFromTextString>true</ResolveUrlsFromTextString>

Why can't I view or edit Umbraco templates?

When I open the Umbraco (7.6.3) backoffice, I'm unable to view or make changes to templates. It seems like other functionality is unaffected, and I can create & edit specific pages. However, attempting to open the templates themselves just leads to a white screen. This problem exists across browsers:
Other screens render just fine:
What gives?
Checking the console when attempting to load gives an interesting error:
Error: Argument 'Umbraco.Editors.Templates.EditController' is not a function, got undefined...
Resolution:
The issue seemed to be caused by outdated files in the Umbraco folder. Copying most directories over from packages\UmbracoCms.7.6.3\UmbracoFiles\umbraco\ seems to have done the trick.
Looking at the changelog, it seems like the JS folder was the most influential in getting this fixed.
Are you sure that you're on 7.6.3? The UI appears to be pre-7.6 (I can tell because the colours haven't been updated).
If you have just upgraded, it's possible that your browser has cached the JS which is used - hard refresh your browser to see if the UI updates.
Umbraco also uses a dependency service to compile all of the used JS/CSS files together into one large one. This service will not be used if your website is in debug mode. Either:
Turn debug mode on in the Web.config
Delete any files in the \App_Data\ClientDependency\ folder as this is where the cached compiled files are kept (these will be regenerated)
My first thought would be file permissions.
Have you run the health check for permissions in the developer section? Need to make sure that your application pool user has write permissions on the Views folder.

HTML5 offline capabilities in a sub directory

I'm trying to setup a iPad app to work offline. I was able to successfully get it to work but I was told to put the app in multiple sub directories. When I did this and update the cache manifest file to the new destinations of all the files I kept getting an error that the site wouldn't work because it wasn't connected to the internet. I tried multiple paths and looked up different ideas but have come up empty handed. Is their a way to get offline mode working with a site inside sub directories?
Thanks.
This shouldn't make a difference. Make sure all urls in the manifest are relative and always end the manifest with:
NETWORK:
*
Furthermore make sure you don't forget to add any images, libraries etc. from the cached url's to the manifest. Sometimes even caps can make a difference. OPen the console of the developer tools in Chrome to see what's being cached and what breaks loading the appcache.
Also make sure there are no iframes (ie. like-buttons) on the homepage(page that includes the manifest attribute in the html-tag) which is always cached.
Little trick:
If you want to fallback you're homepage place the manifest attribute in an invisible iframe on the homepage of your app.
That way you have total control over what's cached and what not.

Resources