| Author |
Message |
Dominik
Guest
|
Posted:
Thu Jan 13, 2005 4:53 pm Post subject:
Deleting an uploaded resource |
|
|
Hi there,
a question: a ressource (e.g. a PDF file) is uploaded directly into a
posting (so not in resource gallery). We only have the GUID Url to that
resource and do not know in which posting it was uploaded. How can I find out
in which posting the resource was uploaded, or if this is not possible: how
can I delete it from the system without knowing the posting it is in?
Thanks a lot,
Dominik |
|
| Back to top |
|
 |
Stefan [MSFT]
Guest
|
Posted:
Thu Jan 13, 2005 6:08 pm Post subject:
Re: Deleting an uploaded resource |
|
|
Hi Dominik,
that is very easy!
The GUID in the URL is the GUID of the posting and not the guid of the
resource.
This is the difference for local attachments and resource gallery items.
So just use the GUID in your SearchByGuid and get the posting object.
Now you are able to get the posting path using the Path property of the
posting.
The code would look like this:
string[] splt = Url.Split('/');
string GUID = splt[3];
Posting p = CmsHttpContext.Current.Searches.GetByGuid("{"+GUID+"}") as
Posting;
string path = p.Path;
Cheers,
Stefan.
"Dominik" <Dominik@discussions.microsoft.com> wrote in message
news:D92A4FF3-F5F9-4DFF-8CFF-54B5E4D6A1CD@microsoft.com...
| Quote: | Hi there,
a question: a ressource (e.g. a PDF file) is uploaded directly into a
posting (so not in resource gallery). We only have the GUID Url to that
resource and do not know in which posting it was uploaded. How can I find
out
in which posting the resource was uploaded, or if this is not possible:
how
can I delete it from the system without knowing the posting it is in?
Thanks a lot,
Dominik |
|
|
| Back to top |
|
 |
Dominik
Guest
|
Posted:
Thu Jan 13, 2005 7:37 pm Post subject:
Re: Deleting an uploaded resource |
|
|
Hi Stefan,
woot! That are great infos! This is very helpful to know. I was afraid that
there is no possibility to indentify the "container posting" for that GUID of
the resource. This saves us a lot of troubles because we have to find the
posting that contains the resource in a set of over 80.000 postings :)
Cheers and thanks a lot,
Dominik
"Stefan [MSFT]" wrote:
| Quote: | Hi Dominik,
that is very easy!
The GUID in the URL is the GUID of the posting and not the guid of the
resource.
This is the difference for local attachments and resource gallery items.
So just use the GUID in your SearchByGuid and get the posting object.
Now you are able to get the posting path using the Path property of the
posting.
The code would look like this:
string[] splt = Url.Split('/');
string GUID = splt[3];
Posting p = CmsHttpContext.Current.Searches.GetByGuid("{"+GUID+"}") as
Posting;
string path = p.Path;
Cheers,
Stefan.
"Dominik" <Dominik@discussions.microsoft.com> wrote in message
news:D92A4FF3-F5F9-4DFF-8CFF-54B5E4D6A1CD@microsoft.com...
Hi there,
a question: a ressource (e.g. a PDF file) is uploaded directly into a
posting (so not in resource gallery). We only have the GUID Url to that
resource and do not know in which posting it was uploaded. How can I find
out
in which posting the resource was uploaded, or if this is not possible:
how
can I delete it from the system without knowing the posting it is in?
Thanks a lot,
Dominik
|
|
|
| Back to top |
|
 |
|
|
|
|