How do I remove the file:/// prefix from the URL filepath:
NSLog(@"File downloaded to: %@", filePath);
Currently it prints as:
file:///Users/Library/Developer/CoreSimulator/Devices/EF752245-9692-4607-B84C-6133202A846B/data/Containers/Data/Application/08686F05-C513-4BDF-A20C-EF3AE1201D54/Documents/2017-02-12_1476366438.zip
EDIT:
I guess I could have done:
NSLog(@"File downloaded to: %@", [[filePath absoluteString] stringByReplacingOccurrencesOfString:@"file:///" withString:@""]);
But isn't there anything build it to NSString that can remove that prefix?
So yes, file URIs are URLs.
Type the rm command, a space, and then the name of the file you want to delete. If the file is not in the current working directory, provide a path to the file's location. You can pass more than one filename to rm . Doing so deletes all of the specified files.
Therefore, the URL of the website have a .html extension. The .html extension can be easily removed by editing the .htaccess file. .htaccess file: The .htaccess file is created with a Text Editor like Notepad. It is a simple ASCII file that lets the server know what configuration changes are to be made on a per-directory basis. Attention reader!
Note: The .htaccess is the full name of the file. It is not file.htaccess, it is simply .htaccess. Removing .html Extension: To remove the .html extension from a URL. For example: Log in to cPanel account. In the Files section, click on the File Manager icon. Click on the Settings Button in the top right corner.
In the current Chrome 69 (69.0.3497.100 ) version, when user opens a file on their computer using Chrome, it will display an URL in the address bar that starts with file:// and then the path of the file is appended as shown below.
The .html extension can be easily removed by editing the .htaccess file. .htaccess file: The .htaccess file is created with a Text Editor like Notepad. It is a simple ASCII file that lets the server know what configuration changes are to be made on a per-directory basis. Attention reader!
filePath.path
is what you're looking for. You don't want to "remove file:///
." You just want the path part of the URL.
Note that this will leave the first /
. I guess you could remove that, but it's unclear why that would be a good idea, since it's part of the path. (If you're gluing this together with other strings that might end in /
, it's better to use path methods like stringByAppendingPathComponent:
to get rid of doubled-slashes.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With