Skip to content

Commit e63b270

Browse files
authored
Add On is now simpler
1 parent e391151 commit e63b270

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

README.md

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# FileBlob Provider AddOn for EPiServer Developers
2-
**Namespace: Gosso.EPiServerAddOn.DownloadIfMissingFileBlob**
2+
**Namespace: Gosso.EPiServerAddOn.DownloadIfMissingFileBlob** Version 1.1 (2016-07-01)
33

44
**Applicable to CMS >7.5 (MVC or Webforms) - tested with CMS9.6.1**
55

@@ -12,49 +12,61 @@ This AddOn is heaven for developers, get rid of copying the production blobs to
1212
## How it works
1313
When the EPiServer CMS page is binding the model to the page, the Provider GetBlob(URI id) is called for every Blob used on the loaded page. The Download If Missing File Blob Provider check if file exists on the local blob directory, if not it requests the Gosso.EpiserverAddOn.DownloadIfMissingFileBlob.UrlResolver.ashx* on the Production server and downloads the file with the friendly URL.
1414

15-
*this ashx must exist on the production server
15+
*this ashx webhandler is automaticly added on init
1616

1717
*The DownloadIfMissingFileBlobProvider is using a web request to the ashx on the production server since the local database is locked (because of possible chance of eternal loop) during request and we don’t have the possibility to find out the friendly URL to the file.
1818

1919
## Performance overload
2020
Yes, initially on application load, it will take some time to download the loaded files.
2121
## Configuring
2222

23-
**UrlResolverUrl** is needed to get the friendly relative url.
23+
**Activated** is needed to get it working. Set to true on DEV, och false in PROD.
2424

2525
**ProdUrl** is pointing to the production server and appends the friendly relative url when downloading the files. For example ProdUrl + “globalassets/images/folder/name.png”
2626

27+
**UrlResolverUrl** is NOT mandatory, can be empty, it is used to get the friendly relative url of the blob.
28+
2729
**RestrictedFileExt** helps to restrict which files to not download
2830

2931
**Path** to the blob url (default "[appDataPath]\\blobs")
3032

3133
```
3234
<episerver.framework>
33-
<blob defaultProvider="MissingFileBlobProvider">
34-
<providers>
35-
<add name="MissingFileBlobProvider"
36-
ProdUrl="http://www.gosso.se/"
37-
UrlResolverUrl="http://www.gosso.se/modules/Gosso.EpiserverAddOn.DownloadIfMissingFileBlob/urlresolver.ashx"
38-
RestrictedFileExt=".docx.doc.pdf.exe.zip.mov.mp4"
39-
type="Gosso.EpiserverAddOn.DownloadIfMissingFileBlob.Provider, Gosso.EpiserverAddOn.DownloadIfMissingFileBlob" />
40-
</providers>
41-
</blob>
35+
<blob defaultProvider="MissingFileBlobProvider">
36+
<providers>
37+
<add name="MissingFileBlobProvider"
38+
Activated="true"
39+
ProdUrl="http://www.gosso.se/"
40+
UrlResolverUrl="modules/Gosso.EpiserverAddOn.DownloadIfMissingFileBlob/urlresolver.ashx"
41+
RestrictedFileExt=".docx.doc.pdf.exe.zip.mov.mp4"
42+
type="Gosso.EpiserverAddOn.DownloadIfMissingFileBlob.Provider, Gosso.EpiserverAddOn.DownloadIfMissingFileBlob" />
43+
</providers>
44+
</blob>
4245
</episerver.framework>
4346
```
4447

4548
## Important/troubleshooting
46-
1. You will need release the addon on the production server (dll and urlresolver.ashx) before you give it a try.
47-
- The easy way, drop the urlResolver.ashx anywhere on prodserver, also put the addon dll in bin-folder
49+
1. You will need release the addon (dll) on the production server before you give it a try.
50+
- The easy way, drop the dll in bin-folder!
4851
2. Do not configure the provider in web.config <episerver.framework>
49-
(or episerverframwork.config) on the production server (even though we have a smaller built in check if it is in production to prevent loops.)
52+
(or episerverframwork.config) on the production server (even though we have a smaller built in check if it is in production to prevent loops.) OR you may set Activated=false
5053
3. The production server must be active/public reachable
5154
4. The files must be public reachable thru a public url
5255

5356
## Installation
54-
Under the release tab you may download the nuget package to your local feed for installation with package manager console in Visual Studio. It will install two file, the Gosso.EPiServerAddOn.MissingFileBlobProvider.dll into the bin folder, and the UrlResolver.ashx, installation path /module/Gosso.EpiserverAddon.MissingFileBlobProvider/. Also configure episerverframework.config with the MissingFileBlob.
57+
Under the release tab you may download the nuget package to your local feed for installation with package manager console in Visual Studio. It will install one file, the Gosso.EPiServerAddOn.MissingFileBlobProvider.dll into the bin folder. Also configure episerverframework.config/web.config with the MissingFileBlob.
5558

5659
You can also download the source code project and add it to your solution, therefore you may easily debug it if needed.
5760

61+
## Customization
5862

59-
60-
63+
If you want to change the default URLResolver path, you may use this web.config and change the **UrlResolverUrl**
64+
```
65+
<location path="modules/Gosso.EPiServerAddOn.DownloadIfMissingFileBlob">
66+
<system.webServer>
67+
<handlers>
68+
<add name="DownloadIfMissingFileBlob" path="/modules/Gosso.EPiServerAddOn.DownloadIfMissingFileBlob/UrlResolver.ashx" verb="GET" type="Gosso.EPiServerAddOn.DownloadIfMissingFileBlob.UrlResolverHelper, Gosso.EpiserverAddOn.DownloadIfMissingFileBlob" />
69+
</handlers>
70+
</system.webServer>
71+
</location>
72+
```

0 commit comments

Comments
 (0)