I have installed media protect on an Umbraco version 7.2.8 assembly: 1.0.5675.2346 today.
Install went just fine, and i also manually checked the install afterwards, and looked through your documentation and everything seems just fine.
Now i have protected a media folder (Rolebased), but not all medias in the folder is protected.
On my project i have a member setup where the members can upload files, and none of the files uploaded through the frontend is protected (but they do have the "public access disabled" icon in the backend, see screenshot)
I have also uploaded 2 files via. the backend, ("Ting" and "asdasd" from the screenshot).
"Ting" which is a pdf file is protected just fine, but "asdasd" which is a jpg is NOT protected.
I have enabled debug-mode to get some more info, and it looks like this:
Protects some files and not others. There's nothing consistent about it - I've used the same file and in one case it is protected, in two other cases it is not.
I've got a customer who's getting a little impatient and would really appreciate some help.
First of all completely missed this post. Sorry about that :-( In future please use [email protected] for urgent issues.
If you protect the folder then all files are protected and with the current version of Umbraco you need to set protectcropedimages indeed.
Can you check if mediaprotect.mvc.dll exists in the /bin folder, if it's not there can you add it manually and if it is there can you add the following line to web.config and see if it works now?
<mediaprotect>
<version>1.6.2</version>
<mediaPickers>
<!--add additional media pickers here-->
<!--
<mediapicker alias="media"/>
<mediapicker alias="filteredmediatreea"/>
-->
</mediaPickers>
<showimagesForUmbracoUsers>false</showimagesForUmbracoUsers>
<enableLogging logPublicMedia="false" csvDelimiter=";" csvStringIndicator=""">true</enableLogging>
<disableMediaProtectDialog>False</disableMediaProtectDialog>
<!--Only enable protectCropperImages when you need to protect cropper images-->
<protectCropperImages>true</protectCropperImages>
<!--When true there will be no returnUrl querystring appended to the url login url-->
<disableReturnUrl>False</disableReturnUrl>
<!--Id of the default login page -->
<defaultLoginNode>1067</defaultLoginNode>
<!--Id of the default not authorized page -->
<defaultErrorNode>1067</defaultErrorNode>
</mediaprotect>
The first 2 files i uploaded through the backend worked just fine and was protected, but when i uploaded one from the frontend it doesnt work, this is the pdf: http://firmamappen.dk/media/4146762376286454_2243.pdf
Interesting that an uploaded item isn't protected. Is that the case for all protected files that are failing? What is the filename in Umbraco of this pdf?
Nothing new, when i change the filename the path stays the same.
And the access still fails.
Does Medieprotect depend on the folder structure? Because i have written a custom upload script for the frontend uploader so that i dont have to use the umbraco /10xx/filename.pdf structure. But as you can see i still add the file in the media section just as the files uploaded through the backend. And they all still lives in the /media folder.
No it does not depend on folder structure but that is the thing that is strange on your end. During validation it checks if the file exists on disk, of it's in the /media folder and it needs to find the id based on filename in the database.. I think somewhere in the upload module something is not stored correctly.
CMSImport is using this method. It assigns stream and that takes care of storing the file correctly and setting the correct values. I think there is a mismatch if you set the file manually. Maybe you can change that?
Weird, Think I'm compiling against an older version that still has some code to handle this. anyway, SetPropertyValue(string propertyTypeAlias, HttpPostedFile value) should work for you I think.
Some media are protected, others are not
Hello!
I have installed media protect on an Umbraco version 7.2.8 assembly: 1.0.5675.2346 today. Install went just fine, and i also manually checked the install afterwards, and looked through your documentation and everything seems just fine.
Now i have protected a media folder (Rolebased), but not all medias in the folder is protected.
On my project i have a member setup where the members can upload files, and none of the files uploaded through the frontend is protected (but they do have the "public access disabled" icon in the backend, see screenshot)
I have also uploaded 2 files via. the backend, ("Ting" and "asdasd" from the screenshot). "Ting" which is a pdf file is protected just fine, but "asdasd" which is a jpg is NOT protected.
I have enabled debug-mode to get some more info, and it looks like this:
This is the entry for "Ting"
But then "asdasd" which is in the same protected folder looks like this:
What can be the problem here? I just want everything in the protected folder to be protected according to the permissions set on the folder.
Have same issue in same version of umbraco.
And media protect 1.6.2
I changed "protectCropperImages" to true in the mediaprotect.config, and that solved the issue with the jpg.
But i still have pdf files in the same protected folder where some is protected (ex. http://firmamappen.dk/media/1030/invoice.pdf)
and some arent (ex. http://firmamappen.dk/media/11459345683790332243.pdf http://firmamappen.dk/media/41462356631209392243.png)
I am also having this issue.
The problem might be that the mediaccess.config node ID does not match the node ID the protection code looks at.
Entry in mediaaccess.config:
Entry in mediaprotectdebuglog
On the one that works, it has the correct ID:
Umbraco 7.2.8, media protect 1.6.2.
Protects some files and not others. There's nothing consistent about it - I've used the same file and in one case it is protected, in two other cases it is not.
I've got a customer who's getting a little impatient and would really appreciate some help.
Hi Bjorn,
First of all completely missed this post. Sorry about that :-( In future please use [email protected] for urgent issues.
If you protect the folder then all files are protected and with the current version of Umbraco you need to set protectcropedimages indeed.
Can you check if mediaprotect.mvc.dll exists in the /bin folder, if it's not there can you add it manually and if it is there can you add the following line to web.config and see if it works now?
Hope this helps,
Richard
I do have the file in the /bin : http://prnt.sc/bojw10
I think you forgot to add the web.config line i should insert. :)
Ok,
Sorry line was added but nor marked as code. Updated now.
Best,
Richard
I added this is the appSettings section in the web.config, still no difference.
Take this file f.x. : http://firmamappen.dk/media/314645988461459_2243.png
It is this one: http://prntscr.com/bok29c
And protectcroppedimages is still true? Can you try with pdf files first?
Yes, this is my full mediaprotect.config file:
The first 2 files i uploaded through the backend worked just fine and was protected, but when i uploaded one from the frontend it doesnt work, this is the pdf: http://firmamappen.dk/media/4146762376286454_2243.pdf
This is the media section: http://prntscr.com/bokadg
Interesting that an uploaded item isn't protected. Is that the case for all protected files that are failing? What is the filename in Umbraco of this pdf?
Its the one with the red cross in the screenshot.
The url is: http://firmamappen.dk/media/4146762376286454_2243.pdf
It seems like that now its only a problem when i upload from the frontend.
I think Something in the upload module is not ok.
Normal file structure is /media/foldername/filename What happens if you replace the file in the backend with another filename?
Nothing new, when i change the filename the path stays the same. And the access still fails.
Does Medieprotect depend on the folder structure? Because i have written a custom upload script for the frontend uploader so that i dont have to use the umbraco /10xx/filename.pdf structure. But as you can see i still add the file in the media section just as the files uploaded through the backend. And they all still lives in the /media folder.
No it does not depend on folder structure but that is the thing that is strange on your end. During validation it checks if the file exists on disk, of it's in the /media folder and it needs to find the id based on filename in the database.. I think somewhere in the upload module something is not stored correctly.
New pdf's from the back-end work I assume?
Maybe you can share the upload code?
The new pdf's from backend are working correctly yes.
Here is my upload script:
Do you see anything is stored wrong? Solving this mystery would be awesome!
CMSImport is using this method. It assigns stream and that takes care of storing the file correctly and setting the correct values. I think there is a mismatch if you set the file manually. Maybe you can change that?
Hmm... The SetValue doesnt accept 3 arguments.
So how did you get that to work? :)
And how do you get the filePath without saving the file on the server first?
I have this now:
Weird, Think I'm compiling against an older version that still has some code to handle this. anyway, SetPropertyValue(string propertyTypeAlias, HttpPostedFile value) should work for you I think.
is working on a reply...