Search Results

Search found 332 results on 14 pages for 'filesize'.

Page 8/14 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • while downloading filenames from non english languages are not getting displayed on the downloaded f

    - by pks83
    When i am trying to download a file whose name has characters from languages like chinese japanese etc...... non ascii... the downloaded file name is garbled. How to rectify it. I have tried to put charset=UTF-8 in the Content-type header property, but no success. Please help. Code below. header("Cache-Control: ");// leave blank to avoid IE errors header("Pragma: ");// leave blank to avoid IE errors header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"".$instance_name."\""); header("Content-length:".(string)(filesize($fileString))); sleep(1); fpassthru($fdl);

    Read the article

  • django return file over HttpResonse - file is not served correctly

    - by Tom Tom
    I want to return some files in a HttpResponse and I'm using the following function. The file that is returned always has a filesize of 1kb and I do not know why. I can open the file, but it seems that it is not served correctly. Thus I wanted to know how one can return files with django/python over a HttpResponse. @login_required def serve_upload_files(request, file_url): import os.path import mimetypes mimetypes.init() try: file_path = settings.UPLOAD_LOCATION + '/' + file_url fsock = open(file_path,"r") #fsock = open(file_path,"r").read() file_name = os.path.basename(file_path) mime_type_guess = mimetypes.guess_type(file_name) try: if mime_type_guess is not None: response = HttpResponse(mimetype=mime_type_guess[0]) response['Content-Disposition'] = 'attachment; filename=' + file_name response.write(fsock) finally: fsock.close() except IOError: response = HttpResponseNotFound() return response

    Read the article

  • Ideablade Update

    - by Tolu
    Hi, I'm using IdeaBlade version 3.6. I noticed the following generated SQL update query : (@P1 nchar(32),@P2 nvarchar(32),@P3 nvarchar(512),@P4 nchar(32),@P5 int,@P6 nvarchar(32),@P7 int,@P8 datetime,@P9 datetime,@P10 datetime,@P11 int,@P12 datetime,@P13 int,@P14 int,@P15 int,@P16 nvarchar(32),@P17 nvarchar(128),@P18 nvarchar(32),@P19 nvarchar(32),@P20 datetime,@P21 datetime,@P22 bit,@P23 nvarchar(32),@P24 nvarchar(64),@P25 nchar(32))update "dbo"."GSS_Documents" set "DocumentID"=@P1,"FileName"=@P2,"FilePath"=@P3,"BusinessOfficeID"=@P4,"Pages"=@P5,"FileSize"=@P6,"DocumentType"=@P7,"DateCreated"=@P8,"EffectiveDateCreated"=@P9,"DateProcessed"=@P10,"ProcessorID"=@P11,"DateReviewed"=@P12,"ReviewerID"=@P13,"WorkflowStatus"=@P14,"ApprovalStatus"=@P15,"AccountNumber"=@P16,"AccountName"=@P17,"SerialNumber"=@P18,"TransactionID"=@P19,"CriticalDate"=@P20,"EmergencyDate"=@P21,"GenerateSMSAlert"=@P22,"CustomerPhoneNumber"=@P23,"CustomerEmailAddress"=@P24 where "DocumentID"=@P25 Problem is DocumentID is the primary key. This update appears to be updating the primary key as well! Any ideas on how to stop this?

    Read the article

  • In Haskell, will calling length on a Lazy ByteString force the entire string into memory?

    - by me2
    I am reading a large data stream using lazy bytestrings, and want to know if at least X more bytes is available while parsing it. That is, I want to know if the bytestring is at least X bytes long. Will calling length on it result in the entire stream getting loaded, hence defeating the purpose of using the lazy bytestring? If yes, then the followup would be: How to tell if it has at least X bytes without loading the entire stream? EDIT: Originally I asked in the context of reading files but understand that there are better ways to determine filesize. Te ultimate solution I need however should not depend on the lazy bytestring source.

    Read the article

  • problem showing pictures stored outside web root folder

    - by David
    On a website users can upload pictures. For security reasons these are stored outside the webroot (public_html) folder. When I need to display the picture, I send the headers and have "readfile" read and output the picture data, like so: header("Pragma: public"); header("Expires: 0"); // set expiration time header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header('Content-type: image/jpg'); header('Content-Length: ' . $filesize); readfile($path_url . '/' . $photo); This works great, but the site is growing and this is starting to be a burden on the server. Question: is there a way to send the picture or picture data to the user, without the server first having to load the picture (obviously with the picture still being stored outside the webroot folder)? Thanks! David

    Read the article

  • HTTP header for sending PDF, problem in Firefox

    - by David
    In windows when i save a pdf with firefox adobe reader plugin ocurs this problem. The file saved is: http://www.example.com/opendocument.php_doc=._docs_doc01 My headers are: header('Content-type: application/pdf'); //header('Content-Disposition: inline; filename=doc01.pdf'); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($pdf)); Original call is: http://www.example.com/opendocument.php?doc=./docs/doc01.pdf I'm not interest on attachment header. I must open into the website, not download o external window. Any idea?

    Read the article

  • Apache Custom Log Format to track complete file downloads

    - by Shishant
    Hello, I am trying to write a reward system wherein users will be given reward points if they download complete files, So what should be my log format. After searching alot this is what I understand its my first time and havent done custom logs before. First of all which file should I edit for custom logs because this thing I cant find. I am using ubuntu server with default apache, php5 and mysql installation # I use this commands and they work fine nano /etc/apache2/apache2.conf /etc/init.d/apache2 restart I think this is what I need to do for my purpose LogLevel notice LogFormat "%f %u %x %o" rewards CustomLog /var/www/logs/rewards_log rewards This is as it is command or there is something missing? and is there any particular location where I need to add this? and one more thing %o is for filesize that was sent and is it possible to log only files from a particular directory? or for files with size more than 10mb. Thank You.

    Read the article

  • Why is scp not overwriting my destination file?

    - by Noli
    I'm trying to back up a file via the command scp /tmp/backup.tar.gz hostname:/home/user/backup.tar.gz When I run it, the scp progress bar shows up and it looks like its transferring the file, however when I log into the destination server to check the file, the timestamp and filesize haven't changed from the older version, so it looks like scp didn't overwrite the old file at all. It only sees to work when I manually delete the file from the destination server. I'm running ubuntu, and this is happening on two servers: one cygwin ssh, and one fedora core 3. Anyone have any idea why this is happening? I thought scp would ONLY overwrite existing files.. Thanks

    Read the article

  • How do I customize what a third party MSM does?

    - by sqlrob
    I'm trying to convert a project in Visual Studio 2008 from static linking of the CRT to dynamic linking. This was easy enough, and I added the CRT MSM and policy MSM to my Wix file with no problems. I am not that happy with the MSI that is output though, it is much larger than what I expected. Looking at the MSI with Orca shows three copies of the CRT DLLs that I need. From looking at the conditions, one of the sets is used for pre-XP installs. Since the system requirements are XP and later, how do I remove this component without touching the original MSM? This needs to be done in an automated build, so Orca isn't a possible solution. Plus, when I tried it with Orca, the filesize remained the same after deleting the File and Component rows. And somewhat related, how do I set the permanent attribute in the components that remain?

    Read the article

  • php - feof error

    - by TwixxyKit
    The file that I'm trying to read is a pgp-encrypted file. This is part of the process to decrypt it and I'm actually attempting to read the contents into a string so that I can then decrypt it . I'm not sure if that's the core problem here or not, but I'm getting an error: Warning: feof(): supplied argument is not a valid stream resource Here's the file code: if($handle = opendir($dir)) { while( false !== ($file = readdir($handle))) { if($file != "." && $file != "..") { $fhandle = fopen($file, "r"); $encrypted = ''; $filename = explode('.',$file); while(!feof($fhandle)) { $encrypted .= fread($fhandle, filesize($file)); } fclose($fhandle); $decrypted = $filename[0].'.txt'; shell_exec("echo $passphrase | $gpg --passphrase-fd 0 -o $decrypted -d $encrypted"); } } }

    Read the article

  • Arraylist as repeater datasource (how to access from .aspx)

    - by Phil
    I have an arraylist: Dim downloadsarray As New ArrayList downloadsarray.Add(iconlink) downloadsarray.Add(imgpath) downloadsarray.Add(filesize) downloadsarray.Add(description) Which is the datasource of my repeater: DownloadsRepeater.DataSource = downloadsarray DownloadsRepeater.DataBind() Please can you tell me how I output the items in the array to the .aspx page. I usually use (when using sqldatareader as datasource): <%#Container.DataItem("1stcolumnnamestring")%> <%#Container.DataItem("2ndcolumnnamestring")%> But this does not work when using the arraylist as datasource. Thanks. ps... I know how to use <%#Container.DataItem% to dump everything but I need to get at the items in the array individually, not have them all ditched out to the page in one go. For example, item 1 contains a link, item 2 contains an image path, item 3 contains a description. I need to have them kick out in the correct order to build the link and icon correctly.

    Read the article

  • What's the best way to convert a .eps (CMYK) to a .jpg (RGB) with Image Magick

    - by Slinky
    Hi All, I have a bunch of .eps files (CMYK) that I need to convert to .jpg (RGB) files. The following command sometimes gives me under or over saturated .jpg images, when compared to the source EPS file: $cmd = "convert -density 300 -quality 100% -colorspace RGB ".$epsURL." -flatten -strip ".$convertedURL; Is there a smarter way to do this such that the converted image will have the same qualities as the source EPS file? Here is an example of the source file info: Image: rejm.eps Format: PS (PostScript) Class: DirectClass Geometry: 537x471 Base geometry: 1074x941 Type: ColorSeparation Endianess: Undefined Colorspace: CMYK Channel depth: Cyan: 8-bit Magenta: 8-bit Yellow: 8-bit Black: 8-bit Channel statistics: Cyan: Min: 0 (0) Max: 255 (1) Mean: 161.913 (0.634955) Standard deviation: 72.8257 (0.285591) Magenta: Min: 0 (0) Max: 255 (1) Mean: 184.261 (0.722591) Standard deviation: 75.7933 (0.297229) Yellow: Min: 0 (0) Max: 255 (1) Mean: 70.6607 (0.277101) Standard deviation: 39.8677 (0.156344) Black: Min: 0 (0) Max: 195 (0.764706) Mean: 34.4382 (0.135052) Standard deviation: 38.1863 (0.14975) Total ink density: 292% Colors: 210489 Rendering intent: Undefined Resolution: 28.35x28.35 Units: PixelsPerCentimeter Filesize: 997.727kb Interlace: None Background color: white Border color: #DFDFDFDFDFDF Matte color: grey74 Page geometry: 537x471+0+0 Dispose: Undefined Iterations: 0 Compression: Undefined Orientation: Undefined Signature: 8ea00688cb5ae496812125e8a5aea40b0f0e69c9b49b2dc4eb028b22f76f2964 Profile-iptc: 19738 bytes Thanks

    Read the article

  • NHibernate How to specify custom sql type only in production

    - by Davide Orazio Montersino
    I am saving binary files into a Sql Server 2005 Db using Fluent NHibernate. However, I am using SQLite to run my (pseudo) Unit Tests. I need to use a custom Sql type for Ms Sql, but it would throw an error on SqlLite. What strategies can I use? This is the Map file: public class BinaryFile { public BinaryFile() { m.Map(x => x.BinaryData);//.CustomSqlType("varbinary(MAX)"); m.Map(x => x.ContentType); m.Map(x => x.FileName); m.Map(x => x.FileSize); } }

    Read the article

  • How to best convert Flash compatible mp4 files with FFMPEG

    - by Espen Christensen
    I am trying to convert different files to a flash compatible .mp4 file with ffmpeg, but i cant seem to succeed. Off cource the objective is to get the greatest quality with the smallest filesize. So far I have this, that works but it doesnt play in a flash player of some reason, and the result isnt that great, anybody got any tips on how to improve this conversion? ffmpeg -i input.file -f mp4 -vcodec mpeg4 -r 25 -b 560000 -s 610x340 -acodec aac -ac 2 -ab 64 -ar 44100 output.file Would be great the se other peoples experiences with this type of conversion.

    Read the article

  • Search filenames in MySQL database table restricted by filetype?

    - by ju
    Hello I have a MySQL database that I replicate from another server. The database contains a table with this columns ID, FileName and FileSize In the table there are more than 4'000'000 records. I want to make fast a search in FileName (varchar) column I found that I can use for this Sphinx search engine. The problem is that I want to restrict searches by filetype. Do I have to and how (trigers?) to extract file extensions for all rows? May be I have to create another table (because this one is replicated) and join them in 1:1 relation? Can you give me some advices please :)

    Read the article

  • How do I rewrite binary data in Java

    - by hayato
    I'm trying to figure out how to replace binary data using Java. below is a PHP example of replacing "foo" to "bar" from a swf file. <?php $fp = fopen("binary.swf","rb"); $size = filesize("binary.swf"); $search = bin2hex("foo"); $replace = bin2hex("bar"); $data = fread($fp, $size); $data16 = bin2hex($data); $data16 = str_replace($search, $replace, $data16); $data = pack('H*',$data16); header("Content-Type:application/x-shockwave-flash"); echo $data; ?> How do I do this in Java.

    Read the article

  • Should we use a CSS frame work ? Are they worth it ?

    - by Gaurav M
    CSS frameworks have nice styles inbuilt and ask you to focuses on the grids but still there is a bit of dependency and lack of freedom it provide.. If I need to generate a webpage by looking on a PSD based mockup screen ..either i will use the classes provided by the framework but if that actual measurements does not exist I need to again specify my own rules that will add upto my CSS filesize and if performance is a constraint as always it is...you need not a big size file..though its in kb but every drop counts. Any comments and suggestions to use the framework in a best possible way.

    Read the article

  • POST data disapearing on large file upload

    - by DfKimera
    I'm having issues with a file uploading utility in my PHP application. When sending large files (9MB+) over the form, I get a very odd behaviour: the POST data I've included in the form dissapears, including the file information. I've already increased all PHP limits I could (time limit, max input time, post max size, memory limit and upload max filesize) and I still can't get the proper behaviour. I've tried replacing the regular HTTP forms with a Flash-based solution (SWFUpload, www.swfupload.org), still the same behaviour. I've tried multiple files of similar sizes and its definitely not a particular file issue. I've debugged the POST vars sent using Firebug, and the correct variables are still there in the header, together with the file. What could be going on here?

    Read the article

  • fread how to Count total from Counter text

    - by snikolov
    hey i have a counter text here and i need to know how to calculate the total this is my information $filename = "data.txt"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); $expode = explode("\n",$contents); /** output 1024 1024 1024 1024 1024 1024 1024 1024 1024 1024 1024 1024 1024 */ I i need to calculate the total by exploding "\n" so i will output 12288 need to understand how to do this i have done this foreach ($expode as $v) { $total = $total + $v; echo $total; } i did not get good results with this

    Read the article

  • can't open file which download with php code

    - by user304828
    header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($file)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); ob_clean(); flush(); readfile($file); i downloaded file but can't open file ? why ?

    Read the article

  • Sometimes, scaling down a bitmap generates a bigger file. Why?

    - by Matías
    Hello, I'm trying to write a method to reduce the size of any image 50% each time is called but I've found a problem. Sometimes, I end up with a bigger filesize while the image is really just half of what it was. I'm taking care of DPI and PixelFormat. What else am I missing? Thank you for your time. public Bitmap ResizeBitmap(Bitmap origBitmap, int nWidth, int nHeight) { Bitmap newBitmap = new Bitmap(nWidth, nHeight, origBitmap.PixelFormat); newBitmap.SetResolution(origBitmap.HorizontalResolution, origBitmap.VerticalResolution); using (Graphics g = Graphics.FromImage((Image)newBitmap)) { g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.DrawImage(origBitmap, 0, 0, nWidth, nHeight); } return newBitmap; }

    Read the article

  • reading binary code of a file...in PHP

    - by Val
    How can I read the binary code(to get the 1s and 0s) of a file. $filename = "something.mp3"; $handle = fopen($filename, "rb"); $contents = fread($handle, filesize($filename)); fclose($handle); I tried this but it shows some strange characters... i presume that this is the formated binary...? I was hoping to get the 1's and 0's instead.... also i am not looking only .mp3 files it could be anything .e.g: .txt , .doc , .mp4, .php .jpg,.png etc.... Thanks

    Read the article

  • c++ library for endian-aware reading of raw file stream metadata?

    - by Kache4
    I've got raw data streams from image files, like: vector<char> rawData(fileSize); ifstream inFile("image.jpg"); inFile.read(&rawData[0]); I want to parse the headers of different image formats for height and width. Is there a portable library that can can read ints, longs, shorts, etc. from the buffer/stream, converting for endianess as specified? I'd like to be able to do something like: short x = rawData.readLeShort(offset); or long y = rawData.readBeLong(offset) An even better option would be a lightweight & portable image metadata library (without the extra weight of an image manipulation library) that can work on raw image data. I've found that Exif libraries out there don't support png and gif.

    Read the article

  • how can i strip formatting from word document using php

    - by shazia
    I want to display a word file and then extract the content and display it in a separate textarea. i want to do away with the formatting as well. this is what i get when i get the read the text file using php ??????ÿÿÿÿ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Running Head: INTERNATIONAL BUSINESS International Business [Name of the writer] [Name of the institution] International Business Question 1 Increasing returns to scale (or economies of scale) in production is an indisputable phenomenon characterizing real world production, and, as such, they have long been recognized as a principal source of economic prosperity. Nonetheless, they have never played a major role in this is the code $fh = fopen($newname, 'r'); $contents => fread($fh, filesize($newname)); fclose($fh); unlink($newname); echo "<br/>"; echo $contents; how can i get rid of all these charecters. Thanks

    Read the article

  • Homemade fstat to get file size, always return 0 length.

    - by Fred
    Hello, I am trying to use my own function to get the file size from a file. I'll use this to allocate memory for a data structure to hold the information on the file. The file size function looks like this: long fileSize(FILE *fp){ long start; fflush(fp); rewind(fp); start = ftell(fp); return (fseek(fp, 0L, SEEK_END) - start); } Any ideas what I'm doing wrong here?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14  | Next Page >