Im new to umbraco, and Im looking for a guide for uploading pictures to a new gallery or excisting one with an usercontrol.
I have allready created document types like in Creative Website Starter 2.0.2, but I dont know how to upload pictures via usercontrol so that they get assigned to a gallery + gets a decription.
Best place to start is the public api for creating media items in code, here's a starting link to the online doc. Find more info on existing media types and/or creating new media types can be found here.
if you need some more detailed info or some code snippets, let us know.
protected void btnUp_Click(object sender, EventArgs e) { //my document type is named Foto DocumentType foto = DocumentType.GetByAlias("Foto"); //Making a new photo Document newPhoto = Document.MakeNew(txbBilledeNavn.Text, foto, User.GetUser(0), Node.GetCurrent().Id); //photoUp is my upload property in my Foto document type newPhoto.getProperty("photoUp").Value = FileUpload1.PostedFile.FileName;
}
This makes an error, trying to upload the photo, how come?
Picture gallery upload through usercontrol
Hey!
Im new to umbraco, and Im looking for a guide for uploading pictures to a new gallery or excisting one with an usercontrol.
I have allready created document types like in Creative Website Starter 2.0.2, but I dont know how to upload pictures via usercontrol so that they get assigned to a gallery + gets a decription.
Hi Falcon,
Best place to start is the public api for creating media items in code, here's a starting link to the online doc. Find more info on existing media types and/or creating new media types can be found here.
if you need some more detailed info or some code snippets, let us know.
Cheers,
/Dirk
protected void btnUp_Click(object sender, EventArgs e)
{
//my document type is named Foto
DocumentType foto = DocumentType.GetByAlias("Foto");
//Making a new photo
Document newPhoto = Document.MakeNew(txbBilledeNavn.Text, foto, User.GetUser(0), Node.GetCurrent().Id);
//photoUp is my upload property in my Foto document type
newPhoto.getProperty("photoUp").Value = FileUpload1.PostedFile.FileName;
}
This makes an error, trying to upload the photo, how come?
is working on a reply...