473,507 Members | 13,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File?

Hi,

i've written a function to check if an image on a server exists:
i send the url to check to the function and check it with:

$file = @file ($url);
if ($file) {

this works ok, as long as i use it on my computer. As soon as i upload
it to my webserver this function won't work. Is this a known security
issue?

Thank you.

Rotsj

May 29 '06 #1
2 1310
Rik
r.**********@home.nl wrote:
Hi,

i've written a function to check if an image on a server exists:
i send the url to check to the function and check it with:

$file = @file ($url);
if ($file) {

this works ok, as long as i use it on my computer. As soon as i upload
it to my webserver this function won't work. Is this a known security
issue?


Is a security issue:

www.php.net:
Tip: You can use a URL as a filename with this function if the fopen
wrappers have been enabled. See fopen() for more details on how to specify
the filename and Appendix M for a list of supported URL protocols.

phpinfo()
check allow_url_fopen

Grtz,
--
Rik Wasmus
May 29 '06 #2
r.**********@home.nl wrote:
Hi,

i've written a function to check if an image on a server exists:
i send the url to check to the function and check it with:

$file = @file ($url);
if ($file) {

this works ok, as long as i use it on my computer. As soon as i upload
it to my webserver this function won't work. Is this a known security
issue?

Thank you.

Rotsj


Did you read php.net on the subject?

http://nl2.php.net/manual/en/function.file.php

(or just go to www.php.net, and type file into the searchbox)

It contains a warning about using url-wrappers.
Maybe that is the problem.

And also: File() is ment to retrieve an array with lines, not very fitting
for an image IMHO.
So file() isn't the right function to take in an imagefile (allthough it
might work allright).

Regards,
Erwin Moller
May 29 '06 #3

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

Similar topics

2
3910
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
5434
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
7
3516
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
26240
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
3910
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
13
4281
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
1
5353
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
3
3150
by: Shapper | last post by:
Hello, I created a script to upload a file. To determine the file type I am using userPostedFile.ContentType. For example, for a png image I get "image/png". My questions are: 1. Where can...
0
2535
by: troutbum | last post by:
I am experiencing problems when one user has a document open through a share pointing to the web site. I use the dsolefile to read the contents of a particular directory and then display them in a...
0
2014
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
0
7223
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
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5041
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...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.