How is it possible to open local HTML file passing parameters from Excel sheet? It seems that passing the parameters works just for URL not for the file protocol.
does not work:
=HYPERLINK("file:///C:/temp/html/new2017.htm?test=123","Search")
works:
=HYPERLINK("http://localhost/html/new2017.htm?test=123","Search")
What would be a way around it?
Related
I am trying to open a HTML file in Microsoft Edge browser from PowerShell.
Below code opens HTML in Microsoft edge
&'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe' #('d:\test.html')
How to pass some values from PowerShell to HTML using URL parameters.
I wanted something like below code
&'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe' #('d:\test.html?testvalue1=45&testvalue2=50')
But the above code opens browser but cannot able to load test.html. Using JavaScript I want to get values from URL which is passed by PowerShell.
You could try the command below.
Start-Process microsoft-edge:"https://localhost?testvalue1=45&testvalue2=50"
Output:
One way to accomplish this is to use the "Start-Process" cmdlet
Start-Process 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe' C:\Web\index.html
This however only works if you know the path. For some reason Powershell fails to translate for example .\index.html to a proper path.
I am building a web app and I would like to show PDF files to my users. My files are mainly stored as byte arrays in the database as they are generated in the backend. I am using the embed element and have found three ways to display a PDF:
Local file path in src attribute: Works, but I need to generate a file from the database byte array, which is not desirable as I have to manage routines to delete them once they are not needed anymore.
Online file path in src attribute: Not possible since my files may not be hosted anywhere but on the server. Also has the same issues as the previous method anyway.
Data as base64 string in src attribute: Current method, but I ran into a problem for larger files (>2MB). Edge and Chrome will not display a PDF when I covert a PDF of this size to a base64 string (no error but the docs reveal that there is a limit for the data in the src attribute). It works on Firefox but I cannot have my users be restricted to Firefox.
Is there any other way to transmit valid PDF data from a byte array out of the database without generating a file locally?
You have made the common mistake of thinking of URLs and file paths as the same thing; but a URL is just a string that's sent to the server, and some content is sent back. Just as you wouldn't save an HTML file to disk for every dynamic page on the site, you don't have to write to the file system to display a dynamic PDF.
So the solution to this is to have a script on your server that takes the identifier of a PDF in your system, maybe does some access checking, and outputs it to the browser.
For example, if you were using PHP, you might write the HTML with <embed src="/loadpdf.php?id=42"> and then in loadpdf.php would write something like this:
$pdfContent = load_pdf_from_database((int)$_GET['id']);
header('Content-Type: application/pdf');
echo $pdfContent;
Loading /loadpdf.php?id=42 directly in the browser would then render the PDF just the same as if it was a "real" file, and embedding it should work the same way too.
We auto-publish a Google Docs Spreadsheet (one tab as CSV). Google docs is providing a fixed URL that refers to the CSV. We import this CSV in another tool for product data import.
Suddenly this URL is redirected by Google Spreadsheet. If we go again in "File/Publish To The Internet" we can the same URL for that CSV.
Question: How can get the URL without redirection again?
Error: Source file
https://docs.google.com/spreadsheets/d/e/2PACX-1vTQsBEmvOwFwxORMqYg2N6LzzYqdqsdDCjxqsdqsdH72gdMCP4xrs1lsN37RO4h1-rjJsQ/pub?gid=501162839&single=true&output=csv doesn't exist (HTTPS : File not found ! (HTTP/1.0 307 Temporary Redirect)). Please check the source file path.
In short, the collection process needs to follow the Location header. Depending how you're getting the CSV this might be simple or a pain. I collect CSVs using curl so just adding the -L switch is sufficient to make sure the incoming files are the CSV we're looking for instead of the HTML that we were getting without -L. Without knowing what utility or process you're using to download the CSV I can't be more specific, unfortunately.
I have a strange situation, I need to run a custom criptography on a file in the moment that the user choose the file to be uploaded.
To achieve that I am running an Applet to crypt the file at the onSubmit event, but once I get the the crypted string from the Applet how can I send that as a regular file upload?
Is there a way to create a blob and then attach it to the file input?
I dont'have access to change the application source code, everything that I can do is write a custom Javascript.
Any help would be appreciated! Thx!
inside my html-file I use some vba-code by clicking a button. I connect to a Adodb to get some data, which is working fine. This data (stored in a recordset) should be saved in an excel-file by using an excel-template. To do this I try to open a local template:
Workbook.Add Template:="MyPath"
I also try to save this file to my local drive.
oExcel.ActiveWorkbook.SaveAs "MyPath"
None of this is working :( Any idea?
It seems that it's not possible to access local data from my browser.