filepath

access file outside public_html using codeigniter 3.X

柔情痞子 提交于 2019-12-12 23:48:29
问题 For security reasons I have the PDF files in a folder called Pdf located just outside the public_html . Im trying to access this file from my controller which lies inside the application folder. I tried using a couple of paths.. One being: ../../../../Pdf/{$name_hash}.pdf . The other being: /home/xx/Pdf/{$name_hash}.pdf I tried to include the file and send it as an js.openwindow as well as readfile($filepath) all to no avail! The files are existing and the name is also generated correctly by

PowerShell: How do I create selector on file/folder, whose name is '*' (asterisk/star)?

余生长醉 提交于 2019-12-12 22:38:33
问题 I have a need to modify registry from PS. This registry item is related to context menu for particular files (folder for all extensions). \\HKEY_CURRENT_USER\Software\Classes\* Currently I'd like to add items to this path: HKCU:\Software\classes\* |- shell |- shellex However when I do dir on this path, there is output of all items in classes folder: PS D:\> dir "HKCU:\Software\classes\*" Hive: HKEY_CURRENT_USER\Software\classes Name Property ---- -------- * .3g2 VLC.backup : WMP11.AssocFile

Accessing files under .jar in a swing application?

与世无争的帅哥 提交于 2019-12-12 18:54:22
问题 Referring to my previous question, I want to ask that how can I read a file in different folder into the similar .jar . The folder hierarchy and details are provided with that question. My main problem is with a line of code: JTextPane textPane = ... //general initialization textPane.setPage("path/file.html"); The problem is I have to keep that file.html in my .jar. Moreover I would like to know suggestions on this topic. 回答1: For loading resources in a JAR, you can use Class.getResource() .

VB6: easy way to get folder name from filepath

自闭症网瘾萝莉.ら 提交于 2019-12-12 17:24:34
问题 If I have the full path of a file: eg. c:\files\file.txt What would be the easiest way to get the folder of this file: eg. c:\files\ ? 回答1: You can use InStrRev for searching for the \ , and Left$ for extracting the path bit: filename = "c:\files\file.txt" posn = InStrRev(filename, "\") If posn > 0 Then pathstr = Left$(filename, posn) Else pathstr = "" End If I'd make a function out of it for ease of use: Function pathOfFile(fileName As String) As String Dim posn As Integer posn = InStrRev

Regular expression for file path which doesn't allow parent directories

邮差的信 提交于 2019-12-12 09:58:26
问题 I'm looking to write a regex for a file path that must start with some prefix. In this case it should start with '/tank/home/'. I also want to make sure that it contains no '/..' -- no jumping up to parent directories. I spent a while fiddling around without coming up with anything quite right. I settled on using two regexes, the first which must match and the second which must not match: '^/tank/home/' '/\.\.(/.*)?$' Does this do what I think it does? Is there an easier way? This is in a

Powershell command to trim path if it ends with “\”

匆匆过客 提交于 2019-12-12 09:35:17
问题 I need to trim path if it ends with \ . C:\Ravi\ I need to change to C:\Ravi I have a case where path will not end with \ (Then it must skip). I tried with .EndsWith("\") , but it fails when I have \\ instead of \ . Can this be done in PowerShell without resorting to conditionals? 回答1: no need to overcomplicate "C:\Ravi\".trim('\') 回答2: Consider using TrimEnd instead (especially if you are working with UNC Path): "C:\Ravi\".TrimEnd('\') 回答3: You mention needing to differentiate between paths

Path separator for Windows and Unix

霸气de小男生 提交于 2019-12-12 09:33:53
问题 Is there any special character that cannot be a part of the path in Windows or Unix that I can use it as a separator? 回答1: Wikipedia helpfully lists the reserved characters for different filesystems. Neither NTFS nor POSIX will accept the null or slash (/) characters in filenames. The slash character is obviously not a good separator, since it's common in POSIX paths, so maybe you could use null. Of course null isn't suited to all situations (e.g. it isn't usually visible when printed), in

How to remove %20 from the file path?

依然范特西╮ 提交于 2019-12-12 07:18:50
问题 file:///home/ashu/Music/Collections/randomPicks/ipod%20on%20sep%2009/Coldplay-Sparks.mp3 How can I convert a string like the above to get the normal file path which I can pass to open() function? 回答1: Have a look at url2pathname: import urllib2 path = urllib2.url2pathname("file:///home/ashu/Music/Collections/randomPicks/ipod%20on%20sep%2009/Coldplay-Sparks.mp3") 回答2: This is called unquote. Avaiable from urllib. import urllib urllib.unquote('%20') 来源: https://stackoverflow.com/questions

how to give path of raw folder in file(string) path format

瘦欲@ 提交于 2019-12-12 07:05:30
问题 hello i need to give path of my pdf file which is in my application raw folder i.e (R.raw.input.pdf) please see my main java file and please help me to give path of the raw folder in public class MainBrowserActivity extends Activity { private Button btnPDF; public Scanner scan; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.main); btnPDF = (Button) findViewById(R.id.btnOpenPDF);

Change path to database in Microsoft Access 2013

假装没事ソ 提交于 2019-12-12 04:55:27
问题 I need to make something in the database. It was saved as .accdb files. I copied this from my workplace and now I want to edit it on my home computer, but when I've open these files and tried to see already made commands I got an error message that I have not a valid path. This error occurs while I want to open command forms for adding and deleting, which need to use other databases. How can I change the path so my Access will know, where these files are stored on my computer? 回答1: Go to band