I'm using LiveSDK in C#. Is there any way to get an URL (for example, url like this: https://onedrive.live.com/embed?cid=1ED5694B634A1579&resid=1ED5694B634A1579%21685&authkey=ANQwPScWiCxbILY) for a specified image file in order to put this link directly to the Image (Source property) control?
I dont want to download a Stream from OneDrive file, set it to a BitmapImage and put it to the Image control.
I know that OneDrive web app allows to create an URL for a selected file, but don't know if the SDK has such feature.
There is a very good example in MSDN Samples Page showing how to pull and use images from OneDrive.
Photo Sky SampleThis sample demonstrates how to use the LiveSDK for pulling images from SkyDrive. In this sample you will learn how to use LiveSDK and request consent from the user to access his SkyDrive files and display the images in a Metro style application.
Source: PhotoSky - SkyDrive Sample
Related
I'm using ASP.NET 4.7.2 MVC framework. I need to upload images using cloudinary and save the url of that image in my database. The problem is, Cloudinary's dot net documentation is a bit confusing as they have just declared a function. How do I make call to that function from my view? I have no idea.
Basically, I have a form and in there I want to add an option for uploading images (which should be done using cloudinary service) and then save the url of the uploaded image in my DB. I have no idea how to achieve that since their documentation only mentions just a function like so:
var uploadParams = new ImageUploadParams()
{
File = new FileDescription(#"c:\my_image.jpg")
};
var uploadResult = cloudinary.Upload(uploadParams);
What do I do with this function and how to use it to add image uploading functionality? Please, help me out. Thanks.
Uploading an asset to Cloudinary can be done either directly from the client-side (i.e., from the View of your application) or through the use of the server-side SDK (i.e., from the Controller of your application).
If you intend to perform the image uploading using the CloudinaryDotNet SDK (https://github.com/cloudinary/CloudinaryDotNet), you will need to submit the image file from the View back to the Controller of your application. And in the controller method, you can invoke the SDK methods to perform the actual image upload to Cloudinary server.
There is a sample project enclosed in the SDK source, which can be found in this link: https://github.com/cloudinary/CloudinaryDotNet/tree/master/samples.
Does anybody know how to specify a download location for specific file types when downloading them through the WebView2 control?
Example:
PDF files go to D:\PDF, and Excel files go to D:\Excel
As far as I know you can only specify a download location when using a WebClient programatically, which can only download from a specific url eg.
WebClient WB = new WebClient();
WB.DownloadFile("http://example.com/example.txt", #"d:\example.txt");
WebView is meant to be a WebBrowser control based on chromium, it will act like a web browser unless you directly modify it (source code).
So to answer your question, there is not a way to specify a download location for a specific file type using the WebView2 control.
You can however build yourself a downloader, which downloads files to a specific location from a url using the WebClient in C#.
I am making a app for SharePoint and have a form with several inputs for text and for files as well. The input for files works fine for regular files such as Word, Excel, PowerPoint, images etc... but wont work with videos. Is it possible to upload a video to a document library by code? Or cant you do that simply because the files is usually to big and would take long to upload?
The files is of the type HttpPostedFileBase and sent by a normal mvc form.
And this is the code for uploading it to the folder
FileCreationInformation attachFileInfo = new FileCreationInformation();
attachFileInfo.ContentStream = pNewRequest.FileToUpload1.InputStream;
attachFileInfo.Url = Path.GetFileName(pNewRequest.FileToUpload1.FileName);
newFolder.Files.Add(attachFileInfo);
According to this StackExchange answer, SP videos are organized in special VideoSet folders which seem to be similar to doc sets.
You said you're using MVC to submit the files so I'm assuming you're using CSOM on an external server. Here's an example for handling video uploads via CSOM.
I created an image uploader using c# mvc5. I managed to upload the images to google cloud storage. Now I want to get the url of the uploaded file to return to the user for reference. I've been looking around the docs in google and can't find it. Anyone can provide me some links or codes will be helpful. Thanks.
See the documentation page on Request URIs.
In general, if you upload to a bucket named foo and an object named bar/baz, the URL for your object will be:
https://storage.googleapis.com/foo/bar/baz
With the GCS C# .NET library, you can use one of the Storage.v1.Data.Object class properties:
MediaLink to get the download link, or
SelfLink to get the canonical URL for the object.
I have a HTML email template in the App_Data folder of my MVC application. In my code, I use this template to send HTML emails to users. This template references a few images in a folder in my project. The issue is that these images don't appear at all when the user receives the email. I have tried to reference the images using ~/path to image/image.gif. I have tried using ../../path to image/image.gif and I have copied the images to the App_Data folder and just referenced the images thus image.gif. Nothing is working. Does anyone have any suggestions?
the images either need to be stored in a publicly accessible location with a full reference to the image <img src="http://my.domain.com/images/filename.ext" /> or the images need to be embedded into the email.
The reason behind the image is not show in email because email client cannot get path you
specified.
For the solution you can do below
First replace the simple image URL to publically access url
[means if you copy the image URL in browser you can access the browser], make sure your image folder is out of authentication
As Jason said you have to put whole url, but if you put your image in App_Data they won't be accessible from outsite because this is a protected folder. You have another option to put images in mail, IMO this is a prefered way to put images in mail, e-mail client won't complain and ask for permission to display images. Here is a example how to do this
http://www.codeproject.com/KB/aspnet/EmbedImage.aspx
you can also use google picasa.
upload the images to picasa, set the visibility to public, get in the album and on the right
side you will have link to this photo link.
press this link and chose the size you want it to be displayed, mark the image only
check box and you will have a link ready to embed in to the mailer.
put the link in the src and that is it.