I am looking for a tweak, addon or a fix to let me open local uri or urls without the file:/// prefix (like in IE or Chrome)
Example:
c:/folder/file.txt
It works if I change the forward slash to backslash, but it I need it like the example, or a fix to treat both slashes the same in Firefox.
Related
In writing platform-agnostic Rust code, are slashes for directory separators OK:
let path = PathBuf::from("dir1/dir2/file")
or is it better to use:
let path: PathBuf = ["dir1", "dir2", "file"].iter().collect();
I don't have a Windows system to test on, but if we have to support Windows in future I don't want to have to go back and fix all the slashes. I don't know what will happen with PathBuf::from("dir1/dir2/file") on Windows: will something convert to backslashes?
Both styles seem present in the docs: https://doc.rust-lang.org/std/path/index.html#simple-usage
I created a droplet that is supposed to pass a file (which is being dropped on the droplet) to a website in safari in a file dialog.
I managed most of it... but the file path I get through "theDroppedItems" starts with file:// and it also includes characters like %20 and ~ and more weird characters.
Is there a way to convert this to a "real path" that safari accepts?
solved:
set inx to item 1 of theDroppedItem
set iny to POSIX path of inx
I am using windows 10 and my vscode always generate path in settings.json with \\ and this will I must edit manually to /. is there's a way how to change this parse if I config settings page via window and not settings.json?
Nevermind, I just write in settings window with / instead of \. e.x: E:/Games/Half-Life/valve/addons/amxmodx/scripting/amxxpc.exe
After i packaged apache to be portable (used any where), I had the surprise to get 403 error on AliasMatch but not on regular Location resources.
Update: I found the fix. Check answer.
And so, here is my own response.
I check the error.log and saw the path of the aliasmatch was wrong ( what a scoop). But note this path is made using a variable. Actually, all the character / that we can expect have been removed.
I look to the origin of the variable but not at the beginning, because all URI based on Location was working. Amazing ! But , the fact is, Location directive seems to convert the ugly \ windows in / to work, but not the AliasMatch directive. I forget to tell that i launched Apache using command line httpd with option -D and ... an ugly windows path with \ and not /. So, i convert the path in a pretty unix path and all is back in order.
In dos command : SET APACHE_ROOT="%THE_WINDOWS_PATH:\=/%"
I have tried unsuccessfully to open image file that it's name contains a space.
I use the following call:
WWW www = new WWW(url);
where:
url = "C:\Users\user\Documents\Files\Thumbnails\sample image.png";
A red question mark appears instead of image.
Also a 404 error appears when print www.error.
If I use another .png file without space (sampleimage.png), it works perfectly. On Windows and Editor it works nice too.
So I tried to replace the space with %20 but an error "can't load the file" appears.
I have also tried WWW.EscapeURL applied on the filename ... but nothing works.
Try to use verbatim string along with file:// prefix:
string filePrefix = #"file://";
string url = #"C:\Users\user\Documents\Files\Thumbnails\sample image.png";