OK, I've been trying to find a way to generate a file size from a PDF file that exists on a different server via a URL. I know there are various ways of doing this if the PDF file is in a local directory (cfdirectory or cffile seem to be able to do this easily enough) but is it possible to generate a file size from the URL link of the PDF file?
Any insight is appreciated. Thanks!
Getting a file size from a URL (PDF) linkIs there a way to do this in ColdFusion?
Page 1 of 1
3 Replies - 2021 Views - Last Post: 12 October 2010 - 01:54 PM
Replies To: Getting a file size from a URL (PDF) link
#2
Re: Getting a file size from a URL (PDF) link
Posted 11 October 2010 - 06:45 PM
I think any solution will require you to at least start the download. Insofar as a solely CF solution goes I believe you'd need to download the entire file first and then see how large it is.
I know there are some downloaders that can get the total filesize as the download starts (so they can update a percentage status bar).
I know there are some downloaders that can get the total filesize as the download starts (so they can update a percentage status bar).
#3
Re: Getting a file size from a URL (PDF) link
Posted 11 October 2010 - 06:55 PM
If you wanted just CF to do it, then you would have to use the CFHTTP tag to download the file and then to a fileRead() on it. If you have access to the server and it runs CF (or any other programming language that can do similar to a fileRead()) you could create a script that when passed the file path it returns the filesize. If the file server is running Linux you could run node.js which has some pretty simple file system functions that you could use.
#4
Re: Getting a file size from a URL (PDF) link
Posted 12 October 2010 - 01:54 PM
Awesome! Thanks!
I'm not sure what the server is running, but this points me in the right direction with the right questions to ask the guys who maintain that.
I'm not sure what the server is running, but this points me in the right direction with the right questions to ask the guys who maintain that.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|