32
Views
3
Comments
Change download folder or move files on disk / auto open Excel
Question
Application Type
Reactive
Service Studio Version
11.54.57 (Build 63234)

I've created reports that I am exporting as Excel spreadsheets.  I'm using actions from the Advanced Excel module from the forge and then the download widget. It looks and acts great except the user has to manually open the downloaded spreadsheet from the download folder.

In a perfect world, I would like to be able to either download the file to a different folder OR be able to move the file to a specific folder. They keep these reports in different folders depending on which report it is. The system I'm replacing does this for them. Is there a way to do this?

Their current system also automatically opens the spreadsheet after it's ready. Is this possible in Outsystems?

Lastly, when I open the downloaded spreadsheet, it opens in protected view, so I can't sort, filter etc. unless I manually enable editing. Is is possible to override that and have it open unprotected?

Thanks. 

2019-01-07 16-04-16
Siya
 
MVP

In Chrome, you can set the default location and also have option for "Ask where to save each file before downloading". 

Concerning the protected view, Excel has Trust Center Setting and you can choose Trusted locations. These locations are treated as trusted sources for opening file.

2023-02-10 10-15-37
Pradeep Dubey

To achieve the functionality of downloading the Excel file to a different folder or moving it to a specific folder in OutSystems, you can follow these steps:

Custom Download Logic: Instead of relying solely on the default download widget, you can implement custom logic using server actions. Within this custom logic, you can specify the destination folder where the Excel file should be saved.

File System Extension: Utilize the File System extension available in the OutSystems Forge. This extension allows you to interact with the file system directly from your OutSystems application. You can use this extension to move the downloaded Excel file from the default download location to a specific folder.

Post-Processing Actions: After generating and downloading the Excel file, trigger post-processing actions that move the file to the desired folder. This can be achieved by calling server actions that handle file manipulation tasks.

User Feedback: Provide feedback to users on the successful download and relocation of the Excel file. This ensures transparency and user awareness regarding the location of their reports.

Automatically Opening Downloaded Spreadsheet:

To automatically open the downloaded spreadsheet after it’s ready in OutSystems, consider implementing these steps:

JavaScript Integration: Use JavaScript integration within your OutSystems application to trigger an automatic open action for the downloaded Excel file. You can utilize JavaScript functions to interact with the user’s system and open files based on predefined conditions.

Client Actions: Implement client actions that execute upon successful completion of the download process. These client actions can include commands to open specific files using system default applications.

Browser Compatibility: Ensure that your implementation is compatible with various browsers and their security settings to prevent any restrictions on automatically opening downloaded files.

Disable Protected View: To disable Protected View in Excel, you can follow these steps:

  • Open Excel and click on "File" in the top-left corner.
  • Click on "Options" in the left-hand menu.
  • In the "Excel Options" window, click on "Trust Center" in the left-hand menu.
  • Click on "Trust Center Settings" in the right-hand panel.
  • In the "Trust Center" window, click on "Protected View" in the left-hand menu.
  • Uncheck the boxes for the options you want to disable, such as "Enable Protected View for files originating from the Internet."

Please note that disabling Protected View can make your system more vulnerable to security threats. It is recommended to use this option with caution and only if you trust the source of the downloaded files.

In summary, while OutSystems does not have built-in functionality to control the download location, automatically open the downloaded file, or disable Protected View, you can provide instructions or use third-party tools to achieve these goals. However, it is important to consider the potential security risks associated with these workarounds.

2019-01-07 16-04-16
Siya
 
MVP

Hello @Pradeep Dubey , while I agree with some points, I'd like to offer clarifications:

  1. Custom Download Logic: It's not feasible to specify the client-side download location from the server side. The user's browser settings determine where the file is saved.
  2. File System Extension: This operates on the server side and cannot dictate client-side behavior
  3. JavaScript Integration: Triggering automatic file opening via JavaScript is not possible due to browser security restrictions. Browsers won't allow such actions.

Thank you for your contributions.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.