Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Disable Download Image To Disk


Could someone please direct me to a way to preventing people from downloading images from my website.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Convert Image And Save To Disk
I am writing a small script to convert from .jpg to .gif

$filename = $_GET['file']; // always .jpg
$type = $_GET['type'];

$im = @imagecreatefromjpeg($filename);
if ($im === false)
{
die('Unable to open image');
}
if ($type == "gif")
{
header ('Content-Type: image/gif');
        imagegif($im);
        imagedestroy($im);
}

This script displays the image on the browser page, whereas I would like to actually have a variable pointing to the relative path, ie. $location = "http://www.xx.com/uploads/image.gif" Any suggestions? I read that imagegif($im,$destination); can be used, but it's giving me errors..

Forcing Image Download
I was just wondering if anyone had bee successful in forcing users to download images to their local machines via a prompt?

I have tried various combinations of using PHP Code:

Image Upload/ Download
I am working on a site for my wife and she needs to upload an image to a database and then download the image. php 5 with mysql 4. Problem is that when I try to display the image it shows up as garbled text (which I know is normal but I am not sure how to display it properly) The attached image is how it looks.

Here is the upload code that I got from the net for uploading an image, this appears to be working. in MyPHP admin it shows the file size of the test image which looks right. Code:

Download Image Link
i have a gallery of pictures and when you click on an image it appears larger in a popup. I have a download button on this popup for the user to download the image and not sure how i can get a save image as dialog box in the code of the button without just right clicking on the image itself. I tried <input type="file"> but thats no good.

Image File Download Using CURL
I need to copy an image file (e.g. a ,jpg) from an http: address to my
web server using PHP. I have been trying to get CURL to work, but for
reasons that aren't clear to me, I can't get it to work properly.

The code I'm trying to use is ($source and $dest are passed in):

$ch = curl_init(rawurlencode($source));
$fp = fopen($dest, "w");

curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);

$isok = true;
$errno = curl_errno($ch);
if ($errno != 0)
{
echo "CURL: ".$errno;
$isok = false;
}

curl_close($ch);
fclose($fp);

I keep getting error 28 (timeout). But if I put the web address of
$source right into my browser, up pops the image (instantly).

Does anybody a) see anything wrong with the above, and/or b) know of
another alternative to CURL to get the job done?

Simple PHP Code--Auto Download Image
What PHP code would I need to simply download an image from an internet address and save it to a location on the server?  At regular intervals?  Can PHP somehow be added to the Windows task scheduler?  I have some security cameras that can FTP images to my server but when I have the FTP enabled and uploading images every 10 seconds, they become unstable and crash.  Viewing the image through the web browser doesn't seem to make them unstable.

Viewing Disk Usage Through PHP
I have a server and am trying to setup my controlpanel for my clients to display their disk usage. I have no idea how I can acheive this, but if anyone could help me figure out a way I would appriciate it.

Php.ini Causes Disk Thrashing In Mysql
For a while I was developing a site with Apache + PHP + MySQL
and, because I hadn't put the php.ini in the right place, php was just
using its default settings. During this time mysql was running fine.
Recently I put the php.ini file in the right place and since then
mysql thrashes the disk intensely during a query, even for really
simple SELECT queries. A php webpage that should finish in less than 2
seconds now takes 10 seconds. I tried duplicating php's default
settings (for mysql) in the php.ini file and it still happens, which
suggests this problem is caused by a setting in the php.ini file which
is not [obviously] related to mysql. If I can't fix this then I'll
have to run php without an php.ini file, which is stupid. Anyone have
any ideas about what settings are causing the disk thrashing?

Hard Disk Space
i would like to know how to find a file in the entire system, i want to create a search so that the user enters the file name and the the script searches the entire system for the file,and later on displays the result of the search.

Disk Quotas And PHP3
My network allows each user to access his/her own home directory in the server, and I limit the disk usage with the Linux Disk Quota System... but the Windows 9x and NT does not recognize the quota format and tells the client that he/she have xxx bytes free where this is the total free, not his/her quota usage... and I can access the user quota usage by repquota -u <user> command....

What I want to know is if is possible to read the user quota and display it in a dynamic web page compiled with php3, so my users can any time refresh and view his / her disk usage and so on...

Remote Disk Space ...
can't manage to do it ..... was so easy under solaris ....
anybody knows how to get free disk space on remote disks ???

(with both local and remote *$#@%§&* machines running *$#@%§&* W$2000)

Unicode Disk Reading
I have a problem with reading from the local disk in a PHP jukebox app ive been working on for a couple months. Im posting on this forum in the hope that some reader has encountered this issue before and can resolve it once and for all! Searching the web only returned one answer, and that was not a desirable one - wait for php6..

This issue only applies to Linux (Debian etch) and OSX, running PHP 5.2.4. The issues does not appear on Windows. Im reading a local file structure which contains mp3's and then displaying them in the browser, where the user can click each track to add it to a playlist. There's a java mp3 player part of the app which runs on the same server to handle the audio.

The problem is that directories/files which include non-ascii characters aren't read correctly by PHP. Here is an example, the first 2 lines may be the same - if you copy-paste out into a text editor you will see the difference. The second line denotes the unicode decimals for each string, and the third line is built from HTML entities using the unicode values. This will enable your browser to display a representation what PHP reads from my disk. (edit: this forum wont let me put html into my post, so the 3rd line will not render!)

/mp3/Björk/
66 106 246 114 107
&#66; &#106; &#246; &#114; &#107;

Is read as:

/mp3/Bjo&#776;rk/
&#66; &#106; &#111; &#776; &#114; &#107;

It was my understanding that PHP would directly read binary data off the disk, where I could interpret it as whichever charset I desire. I believe OSX and Debian use utf-8 as their underlying charset. Converting this using mb_string in PHP doesnt work, and I am at a loss as to how this can be dealt with correctly.

I am using utf-8 encoding through out my application, this problem only exists when reading from the disk! I can also provide some of my PHP test scripts should anyone like to attempt to solve this issue on their local machine.

Writing Cookie To Disk
I am using setcookie() to put a cookie on the visitor's machine. When I do
so, the cookie is set for that browser session, but not written to disk.
What am I missing to write it to the disk? Code snippet:

$cookset = setcookie("origpbx", $_POST['pbx'], 0)



NTFS Disk Quotas
I'm trying, with no luck so far to set and view NTFS disk quotas on Windows Server 2003R2 via PHP. I've been trying to use passthru with WMIC but I can't get it to return anything, not even an error.

Check For Available Disk Space
Does anyone have a nice script (or idea) of how to check for available
diskspace? There must be a better way than traversing all the files and getting the size and substracting it from your hardcoded disksize...

Disk Qouta Script Problem
It's called SubQuota and i using it to restrict the disk quota available in a subfolder. I've configured the script right like the instructions say but i'm still getting errors.
PHP Code:

Readdir From Local Hard Disk
I have written a script to upload images from a clients hard disk to our server, which works fine.

I would like to display all images on a direcvtory so that I can upload an image based upon the thumbnail display. I am having trouble trying to ger a dir listing the clients c: drive?

$fd = opendir("$ImageDir");
while($entry = readdir($fd)) {
$dis = substr($entry,0,2);
if ($dis!= "10"){
if(eregi(".(jpg¦gif¦png)$",$entry)) {

echo "<a href=$PHP_SELF?pic=/images/$entry>/images/$entry</a>";
echo "<a href="/images/$entry">";
echo "<img src="/images/$entry" align=middle
border=0 height=80 width=100>";
echo " $entry</img></a><br>";
}
Where $ImageDIr could be c:/apache/htdocs/images

Can anybody please help?

Check For The Ammount Of Disk Space Being Used
Which function would i use to check for the ammount of disk space being used in a folder or directory?

Finding Local Disk Space
how to find the local disk space in php? I tried the command df -h, it gives me the details of the space for local drives as well as for all the mapped drives. All I want is to get the disk space of local drives. df -l, doesnot work. I can get the space details if I hardcode the drive letter. Need to find the local disk space without hardcoding the drive letters.

Determine Free Disk Space
Is there a way that PHP can determine the amount of free disk space (Linux system)?

I have tried to manipulate the output from $df -h but it's not really working properly.

Save Html-forms Data To Local Disk?
A question on html-forms:

We have an application where users will get a CD with,
among other things, some html-forms for them to fill in.
When they click the submit-button, the data is transferred
to a webserver php-script that will then process the info.
The forms-definition looks something like this:

<form action="http://www.ourdomain.com/receiver.php" method="post">
<p>Question 1:
<p><textarea name="reply01" cols="40" rows="5"></textarea>
<p>Question 2:
<p><textarea name="reply02" cols="40" rows="5"></textarea>
<p>Question 3:
<p><textarea name="reply03" cols="40" rows="5"></textarea>
... etc ...
<p><input type="submit" value="Submit answers!">
</form>

Now, my concern is (since there might be quite a lot of data filled in),
if e.g. the internet-connection for some reason is broken
at the moment when the user clicks the submit-button,
there is a risk they will lose all the text and would have to re-type it,
which I would like to avoid, of course.

How can I best solve this issue?

Ideally, I would like to store the info on their local C: drive
before submitting, and automatically retrieve the text if they
later return to the page, but I guess that's not possible from
an html doc, right?

If so, any other suggestions how to resolve this issue?

How To Find The Free Disk Space On The Network Drives
I need to find the free drive space on the network machines. Looked in to the PHP functions and found that there is only one function 'disk_free_space'. But its written that the function cannot be used to find the free disk space on  the network drives.

Disable Cookie
I am using cookie to hide a variabe in send.php3 as following:send.php3: PHP Code:

Disable Checkbox
I have a checkbox that I set by php code to be either "checked" or "".
I want to disable the ability of the user to check or uncheck it. I
tried "readonly", but that didn't work.

Can I Disable $PHP_AUTH_PW?
Is there any way I can disable the setting of the environment variable $PHP_AUTH_PW? I'm authenticating via LDAP, and don't need (or want) the password available to PHP. I also don't need $PHP_AUTH_USER; the current authenicated user is available in $LDAP_USER.

Disable (grey Out) A Button.
Experienced programmer but new to PHP. Moreover I'm to use PHP with Xoops on
top (this adds object orientation?).

I don't seem to find a xoops Usenet group?

Whatever the case (and presumably a Xoops property): how does one disable
(grey-out) a button?

Disable Right Click In Opera
In my website there is requirement to disable rightclick.
I am providing the code and it is working in I.E ,Netscape and
Mozilla.But not working in Opera browser.
My code is
<body oncontextmenu='return false;'>
The above single line code is working very fine in the above browsers
not in Opera.

Disable Phpinfo In Php3
In PHP4 there is the posibility to disable the use of phpinfo() by putting "disable_functions = phpinfo" in the php.ini-file. Is this also possible with PHP3 (in php3.ini) or is there another way of disabling this function?

How To Disable PHPSESSID From Posting In URL
I don't want the URL to display this info. I never notcied this being displayed before but all of a sudden it seemed to pop-up. I don't host my own server so any access to the php.ini file is not possible. Any ideas out there?

How To Completely Disable Openbase_dir?
I'm using php 4.3.4 and have an intermitent problem with gallery
(gallery.sourceforge.net) regarding the open_basedir restriction in
php. The error I am getting is:
------
PHP Warning: (null)(): Failed opening
'/home/httpd/vhosts/mydom.com/httpdocs/gallery2/main.php' for inclusion
(include_path='.:/usr/share/pear') in Unknown on line 0, referer:
http://mydom.com/gallery2/main.php
------
I have disabled safemode and open_basedir in php.ini and have verified
through a phpinfo() call that they are disabled. Actually,
open_basedir is reported as being set to "no value" and safemode is
reported as disabled.

The strange thing is that this does not happen every time i access this
page. It is only 1 out of 10 times and usually it is the first time i
access the page for the day(but not always). I have restarted httpd
and the server just in case. I also checked .htaccess but it shouldnt
matter since phpinfo() says it is not set. This is baffling to me! If
I could rip this feature out I would. It was installed by default on
my dedicated server.

How To Disable Controle Keys
In my application I want to disable my controle keys to
save copying and taking screen shots of the my page.

How Do You Disable The Close (x) On A Window
I'm running a PHP script on page1.php that takes a few seconds, once it has run the page then redirects to page2.php automatically sending variables . However, if the user shuts page1.php by pressing the X on the top right of the screen, the redirect doesn't happen!! Does anyone know how to disable the X and stop the page being closed down please?? or another solution??

How Do I Unclock The URL/disable Frameset?
I have a few websites out there and set up alittle script for my friends to auto register subdomains for their affiliate sites. Problem is, some affiliate programs don't allow URL MASKING and I can not figure out HOW to disable it within the script. Could someone take a look at this and help me?

I'm trying to disable the frames in forward.php, along with whatever it gets linked to (i'm very new to this, so i included a link to whole script incase there is more then just forward.php I need to edit). Code:

Disable The Values In Address Bar??
Am trying with a social network site... i want to disable the values in address bar which are passing as string variables, My pages are included in the index page.. and my values are passing like that... by changing the values in address bar my page is changing..

How can i solve this issue... i think anyone can change my site using this address bar.. how could i prevent this???

Disable Right-click On Mouse
Is there a php script that wil disable the right-click on mouse or maybe disable the copy and paste feature of the browser?

because i have a client, wherein he wants to prevent public viewing his website from copying his website content?

Disable Command Line Arguments For Php-cli
i have been trying to disable the -n and -c arguments that you can use with php from the command prompt. this is because these features can effectively disable my php.ini which has a whole mess of disabled_functions (that i want to ensure remain disabled).

my best idea for going about doing this so far has been to download the source for the newest php, with hopes to compile my own which will ignore arguments other than a filename. so far the closest i have got is to the the zend_API.c which has the follow function: Code:

Disable .php Handler For A Specific Browser,
I would like to know if there is a way to remove/disable .php handler
when the request come from a specific Browser.

I ask this because I use dreamweaver / webdav to edit my .php files.
But when I try to open the .php file in dreamweaver, what I see if the
result of the .php executions, not the .php source files.

I know that you can create an Alias location "/dav", and disable the
..php handler for this location. It's a solution, but not the best I
think. It would be better if we can disable .php runtime where
dreamweaver Get the files.

Disable Magic_quotes_gpc In A .htaccess File
How do I disable magic quotes via .htaccess?

I put the following file in my webroot, but it does not disable
magic_quotes_gpc (according to phpinfo(), both the local and master value
are still "on")

<IfModule mod_php4.c>
php_value upload_max_filesize 8M
php_value magic_quotes_gpc 0
</IfModule>

The change to upload_max_filesize works (master is 2M, local value is 8M,
according to phpinfo())

Disable Backbutton - When Page Has Expired...
I have this on the page:
<?php
header("Pragma: no-cache");
header("Expires: -1");
?>

but I want it so, that when the user goes back, (s)he might not be
allowed too - say the session has expired.

How can i achive that?


Disable Coding In Textboxes/Textfields
Is there a way to disable PHP, HTML, and the sort in textboxes and input fields? There are things called SQL Injections which are usually used in an url or input field to steal data from the database.

Why Does PHP As Apache Module Disable PHP's Java()?
My site was suddenly running HTTP authentication and was faster.
But if this was a problem from the past, now a entire part of my site does't work because my calls i had to function Java()
now generate this output:

Fatal error: Call to a member function on a non-object
HTTP authentication(PHP as Apache module) versus Java Virtual Machine

what's the relation between them, how can i restore Java() to work properly. Is it on httpd.conf?

why does not PHP call Java extension if it is installed on Apache as a module?

Disable User From Downloading Php3 Web Page.
I would like to allow user only to view php3 page but wants to restrict him from downloading and saving on his hard disk.

Warning: Fsockopen() (how To Disable Debug Messages)
In Win32 PHP you can disable debug messages using the php.ini Can someone tell me how to do that in linux? there is no php.ini in linux Php script running on windows Php script running on linux.

Disable Safe Mode Without Loss Of Security ?
I'm trying to disable safe mode from my php installation. First
because this functionality will be removed in PHP6, and because it's
very restrictive and it's giving me headaches when configuring
frameworks and other applications. Moreover, it's said on the php
website that the safe mode solution is not a good thing... I'm looking
for a tutorial which indicates what to configure on a server in order
to have a secured installation of PHP, but without safe mode. I can't
find it...

Enable/disable Html In Form Processing
I've got a form, where it submits some info and adds it to a txt file. The file is then displayed on the front page of my site; however, there is a security problem i'd like to fix dealing with html. How would you go about disabling the use of html in a form?

PHP Script To Disable/enable Internet Access
We are finally getting DSL again...
but our PC is in the living room... and the youngest has figured out
that if he hits the right keys... he can bring up Internet Explorer.
All is fine and dandy right now, but come next week... that things
wont be so dandy.

I am setting our LInux router/server back up soon, and would like a
quick, easy way to enable and disable our internet access. What I
would like to do is have a simple PHP page that says

(iff network status = inactive)

Your Internet Access is DISABLED
Enter passcode to enable internet access

[TEXTBOX]

Then [OK]

so on clicking "OK" if password = suchandsuch then run script"
"/sbin/network start" or whatever the script is and refresh the page

then

iff network = active

Your Internet Access is ENABLED

[DISABLE]
upon clicking of "DISABLE" run script /sbin/network stop and refresh
the page

Something to that effect.

Disable Passing Arrays In Query String?
Is there any way to stop PHP from turning a query string like this: ?var[] into an array when it is read by $_GET['var']? I have quite a few input validations that are easily screwed up by this strange (and apparently undocumented???) feature...

Disable Submit Button If Text Field Is Empty
I am unsure if this must be done with Ajax, or if it can be done with PHP. I have a simple search page where I want the submit button to be disabled if there is nothing entered in the text field, and once something IS entered, then the search button is enabled.

I was thinking Ajax, because I am looking for it to be real time and I am not sure if its possible with PHP as I am just a novice when it comes to certain things. So the button is always disabled when there is nothing, and enabled when the user enters something.

And lets say the user enters something and removes it, then the button disables again? Is this possible to do with PHP and if so, could someone please help me tackle this . Code:

Mail() Function Blocks Webpage For Nameserver Lookup ! How Can I Disable It?
When mail() function reaches a wrong email address or a down domain name (which it can not resolve it to its IP address) it blocks PHP page for a while. How can I disable this behaviour?

I was able to disable this in mail clients such as Pine by setting an option that tells "Do not make DNS lookups before ading mail to queue" . Is there anything in PHP for doing this?


Copyright © 2005-08 www.BigResource.com, All rights reserved