Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I solved my own thread yesterday: https://our.umbraco.org/forum/using-umbraco-and-getting-started/81385-upload-local-files-to-media-programmatically
But its not solved yet (couldn't find any unsolve-thread-function).
I get no errors when using this:
using Umbraco.Core.Models;
.
umbracoFile = mediaService.CreateMedia(fileName, parentId, mediaType); var streamFile = new IO.FileStream(localFile, IO.FileMode.Open); umbracoFile.SetValue(Constants.Conventions.Media.File, fileName, streamFile); mediaService.Save(umbracoFile); streamFile.Close();
I can see the uploaded files in the BackOffice and the properties. No thumbnails (see image).
But the physical image is not available. No new files under Media-folder in my Web-project in Visual Studio.
My setup:
I looked at this code, but couldn't find any difference: https://github.com/KevinJump/jumoo.usync/blob/master/jumoo.usync.content/helpers/FileHelper.cs#L236
Please Umbraco Forum-bi, you are my only hope!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Upload local files to Media programmatically #2
Hi,
I solved my own thread yesterday: https://our.umbraco.org/forum/using-umbraco-and-getting-started/81385-upload-local-files-to-media-programmatically
But its not solved yet (couldn't find any unsolve-thread-function).
I get no errors when using this:
.
I can see the uploaded files in the BackOffice and the properties. No thumbnails (see image).
But the physical image is not available. No new files under Media-folder in my Web-project in Visual Studio.
My setup:
I looked at this code, but couldn't find any difference: https://github.com/KevinJump/jumoo.usync/blob/master/jumoo.usync.content/helpers/FileHelper.cs#L236
Please Umbraco Forum-bi, you are my only hope!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.