I'm using VB.Net (Basic not C++) and signed in to my account on a website.
There's a URL to a direct text file (I can download as long as I'm signed in to my account on a regular browser).
But when trying this code it doesn't work:
Dim myWebClient As New Net.WebClient()
Dim gaga = "the URL To txt file"
myWebClient.DownloadFile(gaga, Desktop_Path & "\test.txt")
I think there is a way to download a file using credentials but I don't want to do that.
I just want to dynamically get access to a URL txt file from the website webserver and download through the cefsharp so it understands that I'm signed in and allow it. It can't be a FTP URL since obviously I don't have access to their webserver.
Related
I am new to servers and Cpanel. I am building a chrome extension where I have to upload html files to my server, but am unsure as to what the url should be when doing an XMLHttpRequest().If I just type in the name of my website which Cpanel hosts, including the username and password, would that work?
I think what you are looking for is to use the cPanel/WHM API version 1 or 2.
This link should provide you more details on how to use cPanel API, specifically for uploading files:
https://documentation.cpanel.net/display/SDK/cPanel+API+2+Functions+-+Fileman%3A%3Auploadfiles
Could you Please explain in few more words?
I think you are asking
Can i upload files to cpanel! just by url and cpanel username and password ? by using the XMLHttpRequest() ex : from the extension?
If yes.
For private use you can Use PHP FTP classes to run in host
like example.com/myownftp/
or
Cpanel ftp example.com:port for ftp : username and password
Or You can Achieve it by making a script to upload the files to your hosting server its Simple.. PHP is great to do.
I would like to know whether i replied to Your question?
When I try to download the text file in sensenet, the text file will open in browser but not downloaded, could you give some suggestions about how to set to download text file directly?
It's handled by the browser. If it can open a certain file type, then it will show it instead of downloading.
On server side you can force to download file types on your website if your http handler use disposition when set response stream:
response.AppendHeader("Content-Disposition", "attachment");
With sensenet you have to write your own http handler or modify ProcessRequest of SenseNetStaticFileHandler.cs.
MSDN is not too helpful on this topic, but you can find some information on this here.
On client side there is another solution, if you can change the html code of the link. With html5 <a> tag has got a download attribute that forces the linked file to download instead of navigate the browser to it. It works if the browser supports it. See HTML download Attribute.
I use a PHP server to manage Dropbox files for customers.
My server records the user's access token.
But When customers want to upload a file to theirs Dropbox,they must first upload file to my server,and my server use http(php curl) send file to Dropbox through Dropbox Api.
This raises some problem:
1:If C + + client use Dropbox API, they can upload files directly from the local,but use PHP server the file just can local->server->Dropbox,This results in a lower user experience and give the server tremendous pressure.
Is there any way for customers to upload files directly to Dropbox instead of PHP server get whole file and forward.
I need to download a S3 file(in GBs) using javascript in a browser. Please let me know if it is possible and if there are any article with the sample code.
I was able to download the file using the pre signed URL.
http://docs.aws.amazon.com/AmazonS3/latest/dev/PresignedUrlUploadObject.html
Steps:
1) Create a pre signed URL using the bucket, key name and the credential(Cognito).
2) Download the file using the pre signed URL. For downloading file using URL, We can find a lot of article online.
I am developing a windows application in vb.net in which i have a url which first ask me to login on the website and then display a view pdf link. As i make it click it again redirect to another page where instead of asking for download pdf it opens it in my web browser control. Now i want to save that opened pdf on my specified path. I have googled a lot but didn't find any solution for the same. I even found some related posts but none of them have my answer. Here my pdf url doesnt contains any file name like '.pdf'. Url contains some token values. To open this url it requires login on the website. I am trying to download pdf file for many days. Please help me.
you have to push your file using http headers
Unique HTTP Headers Returned
because these headers are the only thing controlling how your browser handles the file.
Save As Mode (askapache_pdf=s)
Content-Disposition: attachment
Content-Type: application/pdf
for more info goto http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html#Unique_HTTP_Headers_Returned
This does not have anything to do with server side scripting language its same that you have to add a response in your header of http request. But anyway in ASP you should try something like below
Response.AddHeader("content-disposition", "attachment;filename=somefile.ext")