I am creating a MVC web application with Docusign REST API.
I am going to create actionlink in index view for each record witch downloads
document in the record's envelope.
I am planning to use call following HTTP request.
GET /v2/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}
When I call this request, I get pop up where I can choose location and name of file for the document that I am downloading.
Is there any way for me to pass folder location and name of file as parameter and download the file without getting this pop up?
I don't think Docusign does not provide such API to download in this way.
Thank you in advance.
A Web Server can not access the client's computer. Imagine if Google (or any other site) could just start programs on your machine when you visit their site! So popup has nothing to do with DocuSign.
So using DS API, you will get pdf as byte[], once you got byte[] then its your code who has to write it to a File and that is not possible on a WEBServer as WebServer will not be able to access the CLient's computer to directly save them on the machine without showing that popup. If you run below code in Standalone Java Application or I think Java Applets can also do it, then you can use FileOutputStream to write byte[] into a file directly in the machine.
Related
I've a .Net/C# Windows application which can create text/pdf files. My requirement is to make these files accessible via http links for another internal application inside my organization. The internal application only accepts http links (ftp and others are not supported).
I know this can be done manually by placing these files in an IIS server. I would like to know whether there is any easy way to do this programmatically? Once the file is created locally in my application, I should have a http link to access the file.
I'm not sure if I understand your need correctly. You can point it out when anything wrong.
Assuming that the application create pdf files in a folder named PDFile. On IIS, you can add a site and set it physical path to PDFile folder. If you enable Directory Browsing, you can see all files when enter the url of this site in browser like this:
When you want to access these file from an external machine, just enter the url http://serverIP:port/PDF file name for example http://xxx.xxx.xxx.xxx:80/mycustomefile.pdf. No need to set anything programmatically.
I'm building a small web video player app for a school project. I'm using a C# Web Service, and an SQL server. My idea was to upload a video, then save its location and name at an SQL table and update the client accordingly.
I know that files can be uploaded through AJAX by sending formdata with XHR, but how do I actually receive them in the web service and save them in a designated path?
in case you'd like to implement a wcf service i think this article fits your needs
File Upload using WCF REST API and JavaScript
I am publishing Windows form application using ClockOnce in ASP.net web application. I understood that when user click on publish button then the clickonce application will be downloaded. this option is unsecure as anyone who know the download URL can download. to add Authentication I am using httphandler as per David P Henry suggestion from codeproject everything is working fine. I would like to add more security to this approach instead of placing the clickOnce app file in Application Files folder in web app I would like to place these files in SQL Server. So my application should able to download these file from SQL Server and send it to user.
Is it possible in Clockonce?
If possible I would like to know the approach.
Yes it is possible. Use a VirtualPathProvider to read the files from SQL instead of the file system.
As ClickOnce requests the files via http/https it is possible to intercept each request and pass your own version (in this case read from SQL instead of the server's file system).
Linked below is a simple project that shows how to utilise a custom VirtualPathProvider.
http://www.codeproject.com/Articles/16848/Creating-Custom-Virtual-Path-Provider-in-ASP-Net-2
I would suggest converting the directory where the files should be stored to an application and adding the Global.asax to the root of the application.
Then add a handler mappings for *.deploy and *.manifest for the root directory so your VirtualPathProvider will run when each file is requested.
Within the overridden FileExists method (in your VirtualPathProvider) write some logic to return if the file exists or not. You could put some authorisation here but I don't know if ClickOnce caches Http responses, as the server would return a 404 if this function returns false.
Within the Stream Open() in your VirtualFile return a MemoryStream read from your SQL server.
Hope this helps.
I have a little problem because on my website I can't really set permissions for the directories, it just doesn't work. I use filezilla and when I try to set them to some subdirectories of a default directory of the server that is publicly readable and writable it doesn't send me an error but when I want to save a file in one of that subdirectories from an asp page I get an error telling that I haven't got the permission to do so, I tried setting 777, so it should work. Using C# I created a FTP client that allows me to edit those subdirectories (those I couldn't edit from the asp page). My question is: can I create an asp page that uses a FTP client to access one of those subdirectories????? Thanks!!!
As I mentioned before you could try WCF and stream files to your server using a web service.
WCF could be fairly complex; however, there is plenty of tutorials online. You could start with this simple tutorial and adjust it to accomplish what you need. They even provide source code.
Basically what you need is a web service with one method, say:
void UploadFile(Stream object)
Then you need to create a web reference from your client (windows form app for example) by providing the address of your WCF web service. This will automatically create the classes you need to execute the method.
This site has more info about streaming files:
set permission to the account that your website uses to access any directory.By default in IIS iis_user account is used.Chage your web site user account to ftp user or any account that have the permission to access those directories.You can easily change this permission using iis7 manager.
I need to upload a file from a winform application to a website.
I have the winform side ready to go, I just need a little help with the webform side.
Client.UploadFile("http://xxx.yyy.com/data/", "sample.txt");
The file(s) that are to be uploaded, binary files, just need to be dumped into a subdirectory called data
I am stuck on the web page that will receive the file and save it into the directory.
c# and asp.net please
thank you
You don't need a web page for accepting the file being sent to server. Probably the easiest way would be to set up ftp on server and upload file there.
Sample code from msdn: http://msdn.microsoft.com/en-us/library/ms229715.aspx