Can I change the maximum size from a file that is being upload (using the sfValidatorFile and the sfWidgetFormInputFile) from 2MB to a bit more? thank you
You have to set the validator option (in bytes)
max_size
Of course it can't exceed upload_max_filesize in php.ini
Related
I have one folder "test" which contains only one sparse file. The logical size of file is 5.24 GB but physical size is zero bytes, which is correctly displayed in file properties, but the physical size of parent folder is not zero bytes. I want to know why there is difference in physical size of file and parent folder and is there any way to modify folder's physical size. Although du -sh returns correct physical size but I want to display it in info too, similar to the way it is displayed for sparse file. I am using High Sierra with APFS. Check the property "Size" of file and folder in below image.
I was trying to check the size of a file before I download it using renci.sshnet in vb.net. The only thing I notice is the .length always return a value of 4096 but the actual file is 700mb. Could someone help me get the accurate file size?
Dim sftpfile = sftp.ListDirectory("/Data/fdb")
For Each ftpFile In sftpfile
If FileSize > (i want to check those higher than 50mb) Then
'output file size
End If
Next
You need to get a reference to the file as an SftpFile object. Then you can access the size attribute. Here's how in C# (converting to VB.NET shouldn't be hard):
SftpFile file = sftpClient.Get(filePath);
return file.Attributes.Size;
What you're probably reading is the internal buffer size (4096) which you shouldn't worry about.
I have merged two streams of caff files into one streo file with the format of m4a/caff
the properties of the files are the following:
44100 Hz, 16bit stereo, 256kb/sec
for a 31 seconds file i get a 667 KB
what can i do to reduce the size of this file after the fact..?
can i convert it to a single channel (mono)? can i reduce the sample size or something like that?
I tried several sample application out their - but none of them gave me a good solution.
Do you have any idea?
Using this command line on the mac worked - but i don't know how to do it on iphone
sudo afconvert -d aac -f 'caff' -b 32768 call_record.m4a test_32.caf
Normally you'd use the ExtAudioFile API to do the conversion. To reduce the size you could convert to a compressed format like AAC. See some sample code here: https://developer.apple.com/library/ios/samplecode/iPhoneExtAudioFileConvertTest/Introduction/Intro.html
I added to my apache log file another information-> %O which is indicated to bytes sent to user including headers. Here is my question how to count the size of HEADERS ? I have already tried $ENV{'CONTENT_LENGTH'} but it isn't it.
I believe there must be the way to determine HEADERS size from CGI script but as for now have no idea how.
Thanks for help in advance ;)
%b logs the size of bytes without headers, so you can calculate the diff to get the header size.
I'm using this method by Dave DeLong to calculate the size of a folder using the Carbon File Manager API:
http://github.com/davedelong/BuildCleaner/blob/b2712242b4eea1fff0e78a08b393a417e3019c8a/NSFileManager+FileSize.m
(Its the first method there)
The issue I'm having is that some folders (.app bundles in my case) are not reporting the correct size. For example, DiskWarrior is 8.2MB, and the method reports 6.6MB
Any ideas on why this is happening?
THANKS
I've improved on that source code of mine that you've linked to. Here's the newer version:
http://github.com/davedelong/BetterInfo/blob/aa1cfe079dad6207a7ddac84b108a768c2cc7156/NSFileManager+BetterInfo.m (You'll also need the corresponding .h file and this support file)
Now instead of returning and NSUInteger, it returns a struct of type "BIItemSyze", which has six members: dataLogicalSize, dataPhysicalSize, resourceLogicalSize, resourcePhysicalSize, logicalSize, and physicalSize.
The Finder will report file sizes rounded to the nearest multiple of the block size (usually 4 KB) followed by the real size in bytes, and many (most) applications are bundles of files, so the true size of the application may be far smaller than the size shown as the first ("on disk") value.
You can test this out by doing something (in the Terminal) like:
echo -n 'foo' > foo.txt
If you Get Info on this file in the Finder, it will report the size as "4 KB on disk (3 bytes)".
If you know how to use applescript's in your code, here's a method o return the size that you'd see in the Finder Get Info window. Note that the returned value is in bytes.
on getSizeInBytesFromPosixPath(posixPath)
try
set b to (POSIX file posixPath) as string
tell application "Finder" to return size of (b as alias)
on error
return 0
end try
end getSizeInBytesFromPosixPath