I am working on a WPF application. In One of the Module ,we are having a file download section. The application will download two files from web server. We have implemented it using WebClient. But the issue is, any person can download these files , if they know the url of file. So we have to implement some Authentication for the download part.
As my know lodge, we have two methods to implement the Authentication
1.Put some access permission to web server folder. And pass these credentials from WPF web client, while download the file.
2.Use a WCF service method to download the files. So that we can download the file after a proper authentication
Please guide me a way. If any other begetter way please let me know.
Any help would be appreciable.
Best Regards,
Ranish
When using MVC its as simple as placing the Authorize attribute on the specific action.
e.g
[Authorize]
public ActionResult Download()
{}
Related
I created some chrome extension that detects a file download event and cancel the download, and gets the download link. Sends the link to myserver.
I want to create a server that recive link to download, download the file, do some manipulation on the file and sends the file back to client.
All the time I developed client side apps (Mainly with c#), and I don't know what to choose for the server side, WCF App or Web API (or something else). the server can be inside the organisation or remote.
What do you think should I pick? any suggestions?
It seems that creating Restful-style services may be more appropriate for this scenario.
You know, both WCF and Asp.net WebAPI can create Restful-style services. WCF could take advantage of the Webhttpbinding to create it.
As for handling file uploads and downloads, I don't think there is any difference between the two techniques. Perhaps the services created by Asp.net WebAPI are a little more mature, such as the ability to deal with form-data stream (multipart/form-data) directly. While WCF service could not directly process the form-data stream.
Here is an example of an upload and download in Asp.net WebAPI.
https://learn.microsoft.com/en-us/aspnet/web-api/overview/advanced/sending-html-form-data-part-2
How to return a file (FileContentResult) in ASP.NET WebAPI
Feel free to let me know if there is anything I can help with.
This might seem as very stupid question but i can't find anywhere answer to my question : How to upload my asp.net website to my webhosting or i need a microsoft provided webhosting. Thanks in advance for your answers
right click publish project file in vs, you have few options to upload it
Use some ftp client to publish your Website Contents to your Server.
You can use FileZilla to publish your website contents.
Some web host provides file up-loader to upload your asp.net file through File manager if you are not uploading too many file or large files you can use web based file manager of webhost For example Go daddy have one.Or make an FTP account on webhost and upload it by FTP Client such as Filezila you can download it from http://filezilla-project.org/ you need webhost who provides asp.net hosting
I'd like to fetch some files from a SharePoint site, however I do not want to use the web services as a) I want to be compatible with both 2007 and 2010 and b) I'm not sure if Web Services can give me all files on a site.
SharePoint Designer can do that, and it seems to use FrontPage Server Extensions using _vti_bin/Author.dll. Also, I can access it in Windows using Map Network Drive -> Map Web Site, which I think is using WebDAV.
Is there any C# implementation of either a WebDAV Client or a Author.dll Client?
You could change this code to download. http://geek.hubkey.com/2007/10/upload-file-to-sharepoint-document.html. Just search around for different upload code and mess with it. I would give you my code for uploading files but I am on vacation and I promised myself that I would not log into work :). That link should get you pointed in the right direction.
Could someone please tell me/link me to how I could create a method similar to those posted below:
http://www.vimeo.com/api/docs/upload
http://www.flickr.com/services/api/upload.api.html
(I am providing the links as I'm not sure how to articulate this question without them!)
I'm using C# ASP.NET. IIS 6.
I have an existing web server with other public API methods. I do not want the iPhone user to have to open a web browser, and post to an aspx page. I want the iPhone developer to be able to call my method, and have one of the parameters be a handle to the file which gets POSTed.
Thanks in advance for any help.
You'll need to create a WCF Service Application. You can use this as a webservice that can be exposed to your clients. You can create a RESTful service using WCF where clients can POST video's to.
When searching for 'REST, API, WCF' you'll probably find all the resources you are looking for.
I'm trying to use SWFUpload with an ASP.NET Web Forms project. I need to get at Request.Files[0] But I can't do that in my WebService!
Anyone know a way around this?
Thanks in advance.
From what I can tell SWFUpload is a JS/Flash front-end control that is designed to work with a form, NOT a web service. My guess is that if you need to in the end send the file to a web service you will need an intermediate page to take the upload and submit to the service.