I need to upload this image to umbraco media folder programmaticaly.
P.S. I make migration of one site to umbraco. and I have directory of images, that I need to upload in media. I know about ZipUpload pack? but I need to do some additional actions when I upload files, that's why I can use ready pack.
Can u give me the pogram code of how to upload single file to media folder and create media item in umbraco.
i know how to create media item usint Media.MakeNew, but I dont know, how to move file to Media\{someId}\filename. What is this folder {someId}? Can u give full code.
I tried to analize zipUpload pack, but I have no any results. May be creator of this pack give me the code for single jpg file, not for archive of files.
How I can add thumb for this image? I create 0_big_thumb.jpg near 0_big.jpg, but I dont see thumb on umbraco. Maybe I need to registrate thumb image, but how?
add media items programmaticaly
Hi!
I have an image for example c:\Image1.jpg.
I need to upload this image to umbraco media folder programmaticaly.
P.S. I make migration of one site to umbraco. and I have directory of images, that I need to upload in media. I know about ZipUpload pack? but I need to do some additional actions when I upload files, that's why I can use ready pack.
Can u give me the pogram code of how to upload single file to media folder and create media item in umbraco.
i know how to create media item usint Media.MakeNew, but I dont know, how to move file to Media\{someId}\filename. What is this folder {someId}? Can u give full code.
I tried to analize zipUpload pack, but I have no any results. May be creator of this pack give me the code for single jpg file, not for archive of files.
after I move all images to media, I plain to add media items using UI. So I need to genereate media as umbraco make it ( to avoid conflicts).
I am actually working on this myself. If I find a way to do it I will post it here.
Hope the posted code will get you on your way. Let us know how your doing :)
I have error CS0103: The name 'thumbBMP' does not exist in the current context
I have thumb image how I can add it to current Image?
thumbBMP doesn't get used in the function does it? take it out and see what happens
this is my code
Media m= Media.MakeNew("99", MediaType.GetByAlias("image"), author, 1072);
m.getProperty("umbracoFile").Value = "http://localhost:31235/media/6014/"+"0_big"+".jpg";
How I can add thumb for this image? I create 0_big_thumb.jpg near 0_big.jpg, but I dont see thumb on umbraco. Maybe I need to registrate thumb image, but how?
is working on a reply...