Download the .exe file instead of .htm file - dropbox

My website has an option of downloading a .exe file. I uploaded this .exe file in dropbox and use the shared link in my website for the users to download the file.
I use href in my index.php page to create a link to that file:
<a href="https://www.dropbox.com/s/........./File.exe?dl=0" download="File">
But when users click that link in my website it downloads the .htm file. The users need to click this .htm file again which then leads to the download of the .exe file. At times users also get the error "There was an error downloading your file." while downloading the file from dropbox. I would like to know how to get the link to download the .exe file directly. Thanks!!!

When you use ?d1=0 at the end of your file path it will show the file in a preview page. Try changing it to ?dl=1to force the download.
https://www.dropbox.com/help/desktop-web/force-download

Related

Firefox removes extension on files when specific download folder is set on options

I'm having a problem downloading files on Firefox 62.0.2 (64-bit) or Firefox Developer Edition 63.0b9 (64-bit). On Internet Explorer works fine.
I've an admin panel with two buttons to download PDF's. When I click the buttons download pop-up shows and tell me to open the file or save it (and recognize the file as a PDF file). If I choose to open it it opens, but if I've set in the options to save the files on a specific folder, the file is saved with no extension. But if I've set on the options to specify the folder to download everytime, the file it's saved with the extension.
Here you can see the pop-up when it opens:
Then, If I've set on options download always to a specific folder:
But if I've set on the options to specify a folder everytime I download a file:
The file it's saved with the extension. On the code I've set the headers:
response.setHeader("Content-Type:", "application/pdf");
response.setHeader("Content-Disposition", "attachment; filename=\"desglose.pdf\"");
The URL to access to this resource it's:
#GetMapping(value = "/{id}/desglose")
#Secured(AuthoritiesConstants.ADMIN)
And after read this link Firefox cuts extension on files I don't know where it's my mistake. What I'm doing wrong?
Regards.
Ok, while reading the code after had copied here the lines, I noticed that after the function in other class there was a line with:
response.setHeader("Content-Disposition", "attachment");
which was overriding the value:
response.setHeader("Content-Disposition", "attachment; filename=\"desglose.pdf\"");
and was causing the problem. After remove the line response.setHeader("Content-Disposition", "attachment"); the downloads work fine.
Regards!

How to open HTML properly in WinSCP

I am trying to use WinSCP to access a remote HTML file, and I do have root permission. However, if I open that HTML, it seems that all the sources and scripts are dysfunctional, e.g no images, buttons etc are loaded, and no js functions work. So how can I open a HTML using WinSCP so that all the sources are loaded and work properly? Thanks a lot.
I assume you "Open" the HTML file from a remote panel of WinSCP.
This makes WinSCP download the file to a temporary local folder and open the file from there.
As all the references to images and java script files are typically relative paths, they won't work from the temporary folder as the referenced files are not there. So it cannot work.
Either you need to download all files (including images and .js) to a local folder and open the HTML there.
Or you actually want to open the file from the server, via HTTP.
For that use the WinSCP extension "Generate HTTP URL".

automatically place downloaded files in folder bsed on downloads extension suffix

I’m making a simple web browser for work eeh, what I’d like to know is if its possible to save a file of a particular extension to a particular file.
I currently use google chrome when downloading a file it places this (regardless of extension) in a downloads folder without asking where I ant to download this too.
I want to achieve the same except that downloads with the extension .dwg are placed automatically in a folder named DWG DOWNLOADS…
How to achieve this in vb.net?
In any browser you have a config section.
In Firefox you have browser.download.useDownloadDir;true and browser.download.folderList;1
you can add your own config to allow different saved folder paths and dynamically modify them depending on the extension of the file you uploaded.
See a complete list of the web browser config with about:config in address bar.
Not real sure what you are asking, but if you are actually making a web browser just check the extension of the file you are requesting to download. If the extension is ".dwg" then save the file to the folder you want.
If you are wanting to automatically move Google Chrome downloads to a different directory, you can use a FileSystemWatcher to monitor for new files in Chrome's download directory and move them to another folder based on each file's extension.

How to upload files in the downloads folder in the terminal?

How to upload files in the downloads folder in the terminal?
My folder is https://github.com/rg3915/LaTeX/downloads but I can only go through the site. And when I try to download gives error.
That usually indicates a problem during the upload, making the download impossible.
See this thread for illustration:
Try it with flash disabled.

Apache Config Mime Types: xlsx files are being interpreted as zip files on download, why?

Background: For some reason, whenever a user tries to open an xslx (excel 2007) file from our intranet using MSIE, the file download dialog interprets it as a "zip" file.
Admittedly, xslx files really are zip files, but we don't want that behavior. Just open in Excel, please.
Question:
Firefox, OTOH, opens the files normally. Is it possible that the fault is my apache configs? or is this a client-browser-only issue?
You must add some new MIME-TYPES on the web-server-side.
See the comment-thread on this windowsnerd.com page (from 2009):
Add this to a .htaccess file and throw it on your site: AddType
application/vnd.openxmlformats .docx .pptx .xlsx .xltx . xltm .dotx
.potx .ppsx
Should fix many of the problems.
Alternatively, you can add this to the mime.types file located in the config directory of your Apache web server
application/vnd.ms-word.document.macroEnabled.12 .docm
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
application/vnd.ms-powerpoint.template.macroEnabled.12 potm
application/vnd.openxmlformats-officedocument.presentationml.template potx
application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
application/vnd.ms-excel.addin.macroEnabled.12 xlam
application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
application/vnd.ms-excel.template.macroEnabled.12 xltm
http://www.webdeveloper.com/forum/showthread.php?t=162526
The reason is IE's strange MIME sniffing behaviour: http://msdn.microsoft.com/en-us/library/ms775147.aspx. It basically tries to determine to the file type of a file by looking into its contents, somehow like Linux's file tool.