473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

file_get_contents & spaces in file name

I'm running php on linux. Oddly enough, there are files that I must parse
with php where the file name contains one or more spaces. Permissions are
set correctly, however file_get_contents returns blank. Do I need to do
anything special to be able to get at these files?

Example file name:

DALCO - APR 2008 INVOICING.pdf

tia,

me
Jul 8 '08 #1
3 4795
Barry wrote:
I'm running php on linux. Oddly enough, there are files that I must parse
with php where the file name contains one or more spaces. Permissions are
set correctly, however file_get_contents returns blank. Do I need to do
anything special to be able to get at these files?

Example file name:
DALCO - APR 2008 INVOICING.pdf
Hi Barry,
sorry, I cannot confirm that. My tests output the content of a file whos
name contains blanks.
I'd do three things in your case:
a) check if the whitespaces are blanks or something else. Are the filename
and the name you want to open the file under *really* the *same* ?
b) check the return value of fel_get_contents(). Ist it really empty ? I
cannot belive that. It should return FALSE in case of a problem.
c) post a complete example

arkascha
Jul 9 '08 #2

u can get content of any file with file_get_contents. i think there
must be some error messages. enable error reporting first.
Jul 9 '08 #3

"Barry" <no****@example.comwrote in message
news:Sv*************@newsfe02.lga...
I'm running php on linux. Oddly enough, there are files that I must parse
with php where the file name contains one or more spaces. Permissions are
set correctly, however file_get_contents returns blank. Do I need to do
anything special to be able to get at these files?

Example file name:

DALCO - APR 2008 INVOICING.pdf
Thanks all. I got it fixed.
Jul 9 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rob | last post by:
for some reason i keep getting : Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/rob/www/php/filegetcontents2.php on...
2
by: ggg | last post by:
Here's what I'm trying to do. The server serves up XML documents based on what I specify in the GET string. This is on a server I have no control over. There is a lag between the time when I...
3
by: Csaba Gabor | last post by:
I've got a section of code that takes a user supplied $url and essentially does: function redirectRequest($url) { $resultRemote = @file_get_contents($url); return $resultRemote; } Is there a...
25
by: mdh | last post by:
Hi Group, Not looking for an answer, but more of an explanation. Thinking back to those heady days when you had the time to do them, may I ask this. Exercise 1-22 asks for a program to "fold"...
5
by: howa | last post by:
are there any advantage in replacing all fread() operations with file_get_contents() ? i.e. file_get_contents("/usr/local/something.txt") VS $filename = "/usr/local/something.txt";
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
4
by: Aetherweb | last post by:
This is probably really obvious, sorry, been a long day... I'm wanting to create a PHP file which is a template for an email, and read the file into a string, ready to send out using my email...
6
by: Pheddy | last post by:
Hey i tried this code to get the country and IP via PHP (from: http://roshanbh.com.np/2008/07/getting-country-city-name-from-ip-address-in-php.html) function countryCityFromIP($ipAddr) {...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.