09-21-05 10:52 PM
Hi,
you have created an applicaiton context in update mode but you are trying to
upload the item using the CmsHttpContext which is most likely not in update
mode.
That will not work.
You need to retrieve the gallery using the application context and not using
the CmsHttpContext then the upload will work.
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
"dsen_25" <dsen_25@yahoo-dot-com.no-spam.invalid> wrote in message
news:TOadnUml47uhyqzeRVn_vA@giganews.com...
> Dim gallery As ResourceGallery =
> CmsHttpContext.Current.Searches.GetByGuid(UserMenuLocalTree.GetNodeFromInd
ex(UserMenuLocalTree.SelectedNodeIndex).ID())
>
> Dim AppContext As CmsApplicationContext = New
> CmsApplicationContext
> (Microsoft.ContentManagement.Publishing.CmsHttpContext.Current.User.Server
AccountName,
> "abc@123", PublishingMode.Update)
>
>
>
> 'AppContext. AuthenticateAsCurrentUser(PublishingMode
.Update)
> Dim gallery As ResourceGallery =
> CmsHttpContext.Current.Searches.GetByGuid(UserMenuLocalTree.GetNodeFromInd
ex(UserMenuLocalTree.SelectedNodeIndex).ID())
> If gallery.CanCreateResources Then
>
> gallery.CreateResource(txtMainImg.PostedFile.FileName)
> Else
> errMsg = "cant't create"
> End If
>
> *******************
>
> when i execute above code i got access denied error.how to solve that
> error. Any one pls help me.
>
[ Post a follow-up to this message ]
|