fileinfo

Get file info from NTFS-MFT reference number

坚强是说给别人听的谎言 提交于 2019-12-01 17:19:47
问题 In my C# application, I already have a way to examine the file system but I would like to take advantage of reading from the Master File Table (MFT) because it is so much faster. I understand that 1) it is a proprietary specification and therefore subject to change without notice, and 2) it is only accessible when the application is running under administrative privileges. I managed to read the Master File Table via this code. From the MFT query, I get a file name and a so-called file

Laravel 4 - no guessers available issue

核能气质少年 提交于 2019-12-01 15:50:18
I get this error: LogicException: Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?) while trying to upload an image. I have enabled the php_fileinfo extension and also restarted the Wamp web server but I still unable to solve this. What am I missing? Thanks Below are my codes: Models: Product.php class Product extends Eloquent { protected $fillable = array('category_id', 'title', 'description', 'price', 'availability', 'image'); public static $rules = array( 'category_id'=>'required|integer', 'title'=>'required|min:2', 'description'=>

SSIS Read file modification date

别来无恙 提交于 2019-12-01 03:48:26
问题 We have an SSIS process that imports various files in different formats from various sources. Each of these files is delivered at different times throughout the month. The users would like to be able to see the modification date for each file, to check they are getting regular updates. The aim would be to produce a table at the end of the process like this: So I am trying to work out how to get the modification date of each of the files I have read in. Is there a way to do this in SSIS ?

fileinfo function PHP

为君一笑 提交于 2019-12-01 01:27:52
Can someone give me an example of how to use fileinfo , to replace a snippet of code such as: ($_FILES["fileToUpload"]["type"] == "image/gif" || $_FILES["fileToUpload"]["type"] == "image/jpeg" || $_FILES["fileToUpload"]["type"] == "image/png") Using this: $finfo = new finfo(); $fileinfo = $finfo->file($file, FILEINFO_MIME); $fileinfo should contain the correct MIME type which you would be able to use in a snippet like that, or in a switch statement like: switch($fileinfo) { case "image/gif": case "image/jpeg": case "image/png": // Code break; } $objInfo = new finfo(FILEINFO_MIME); list(

ASP.NET MVC getting last modified date/FileInfo of View

妖精的绣舞 提交于 2019-11-30 22:29:07
I'm required to include the last modified date on every page of my applications at work. I used to do this by including a reference to <%= LastModified %> at the bottom of my WebForms master page which would return the last modified date of the current .aspx page. My code would even check the associated .aspx.cs file, compare the last modified dates, and return the most recent date. Does anyone know if you can read the FileInfo of a MVC View? I would like to include it in the master page, if possible. I have a base controller that all wired up and ready to go. All I need to know is how to

DirectoryInfo, FileInfo and very long path

别来无恙 提交于 2019-11-29 17:52:00
问题 I try to work with DirectoryInfo, FileInfo with very long path. I try use \\?\c:\long path (i got illegal caracter with fileInfo and DirectoryInfo) I try use file://c:/long path (i got uri not supported) Can i use ~ in a path or something else. I read this post but i would like to use another way that call a API. Is it any other solutions ? There is an article from microsoft for use \\? in file path link text The question is how can i work with very long path, and DirectoryInfo, and FileInfo

Finfo_file on uploaded file to determine mime-type

ⅰ亾dé卋堺 提交于 2019-11-29 17:47:35
问题 Im trying to determine the mime-type of an uploaded file, i want to use fileinfo(), this is what ive been trying, it isnt working: $uploadedfile = $_FILES['soup']['tmp_name']; if(isset($uploadedfile)) { $uploadedname = $_FILES['soup']['name']; $file=$uploadedsong; $file.=$uploadedname; $finfo = finfo_open(FILEINFO_MIME_TYPE); $mime = finfo_file($finfo, $file); Unfortunately the finfo_file doesnt seem to be running, Im assuming i have the following $file set incorrectly for this, is there a

Blank space after file extension -> weird FileInfo behaviour

橙三吉。 提交于 2019-11-29 10:25:19
Somehow a file has appeared in one of my directories, and it has space at the end of its extension - its name is "test.txt ". The weird thing is that Directory.GetFiles() returns me the path of this file, but I'm unable to retrieve file information with FileInfo class. The error manifests here: DirectoryInfo di = new DirectoryInfo("c:\\somedir"); FileInfo fi = di.GetFileSystemInfos("test*")[0] as FileInfo; //correctly fi.FullName is "c:\somedir\test.txt " //but fi.Exists==false (!) Is FileInfo class broken? Can I somehow retrieve information about this file? I really don't know how did that

C# - Add, edit and delete tags of file

穿精又带淫゛_ 提交于 2019-11-28 09:02:00
问题 I would like to add and retrieve tags of files in File System. As you can tag Stackoverflow question to the relevant topics, you can tag a file in Windows file-system: The following way doesn't give me access to the tags of the file, but only to other file properties. string file = @"C:\Users\me\Desktop\MyFile.doc"; FileInfo oFileInfo = new FileInfo(file); MessageBox.Show(oFileInfo.FullName); Any ideas how to access the tags using the simple API of System.IO ? 回答1: As you can tag

Blank space after file extension -> weird FileInfo behaviour

拟墨画扇 提交于 2019-11-28 03:40:11
问题 Somehow a file has appeared in one of my directories, and it has space at the end of its extension - its name is "test.txt ". The weird thing is that Directory.GetFiles() returns me the path of this file, but I'm unable to retrieve file information with FileInfo class. The error manifests here: DirectoryInfo di = new DirectoryInfo("c:\\somedir"); FileInfo fi = di.GetFileSystemInfos("test*")[0] as FileInfo; //correctly fi.FullName is "c:\somedir\test.txt " //but fi.Exists==false (!) Is