i am using ftp_put to upload files to the server. However How do you determine what mode to use for files like word, excel and pdf? as i no images would be binary.
Whats the best way to check if the file is ASCII or BINARY?
Determining FTP_ASCII or FTP_BINARY
Moderator: General Moderators
Re: Determining FTP_ASCII or FTP_BINARY
do the file have extensions?
I will use that to start with
I will use that to start with
Re: Determining FTP_ASCII or FTP_BINARY
For uploading unknown files, I think I'd just always make it binary. File extensions can be misleading. I don't know of any reliable way to determine in advance whether a remote file is ASCII or not.kendall wrote:i am using ftp_put to upload files to the server. However How do you determine what mode to use for files like word, excel and pdf? as i no images would be binary.
Whats the best way to check if the file is ASCII or BINARY?
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: Determining FTP_ASCII or FTP_BINARY
hmmm....thanks calif...i was running a preg_match on file ext....will using binary make text based files readable? as these files maye need to be "included" or fread
Re: Determining FTP_ASCII or FTP_BINARY
To the best of my knowledge, ftp binary mode will read any file. I *think* ASCII mode is just a little more efficient if the file contains nothing but ASCII characters. Here's a pertinent thread on another forum: http://www.velocityreviews.com/forums/t ... inary.html