File Upload

This is a discussion on File Upload within the alt.comp.lang.php forums, part of the PHP Programming Forums category; My church wants to put a file upload interface on their website so that when they go off to other ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-24-2006
Kevin Raleigh
 
Posts: n/a
Default File Upload

My church wants to put a file upload interface on their website so that
when they go off to other countries they can load photos directly on to
the server. I haven't done this in a while and only in CF, but if I remember
correctly file upload is a pretty straight forward proceedure.

The question is how to handle security?

The server is on the church grounds and so the church handles it's own
server setup. Also the last time I played around with PHP it was version
4.0 so all the books that I have on PHP are probably a little out of date.
Not to mention that there was no mention at all about constructing a file
upload page.

any insight would be greatly appreciated
Kevin Raleigh


Reply With Quote
  #2 (permalink)  
Old 07-25-2006
Nyoka
 
Posts: n/a
Default Re: File Upload

Basic authentication can be done something along these lines:
<?
if (!$PHP_AUTH_USER) {
header ("WWW-authenticate: basic realm=\"secure area\"");
header ("HTTP/1.0 401 Unauthorized");
echo "<metta http-equiv=\"refresh\"
content=\"0;url=failedlogin.php\">";
exit;
}
?>

$PHP_AUTH_USER - username
$PHP_AUTH_PW - password

By default PHP will upload file to the global variable $_FILES; if the
form file input tag is called "thefile" then $_FILES["thefile"] will
contain an array with various items see PHP's global varibles
documentation for full details.

Kevin Raleigh wrote:

> My church wants to put a file upload interface on their website so that
> when they go off to other countries they can load photos directly on to
> the server. I haven't done this in a while and only in CF, but if I remember
> correctly file upload is a pretty straight forward proceedure.
>
> The question is how to handle security?
>
> The server is on the church grounds and so the church handles it's own
> server setup. Also the last time I played around with PHP it was version
> 4.0 so all the books that I have on PHP are probably a little out of date.
> Not to mention that there was no mention at all about constructing a file
> upload page.
>
> any insight would be greatly appreciated
> Kevin Raleigh


Reply With Quote
  #3 (permalink)  
Old 07-25-2006
Hoopster
 
Posts: n/a
Default Re: File Upload


I tried this and it works fine, but I don't know what to put for the
username and password. Do I need to create a new file to store that
information?




On 25 Jul 2006 09:22:58 -0700, "Nyoka" <isaac.scott@gmail.com> wrote:

>Basic authentication can be done something along these lines:
><?
>if (!$PHP_AUTH_USER) {
> header ("WWW-authenticate: basic realm=\"secure area\"");
> header ("HTTP/1.0 401 Unauthorized");
> echo "<metta http-equiv=\"refresh\"
>content=\"0;url=failedlogin.php\">";
> exit;
>}
>?>
>
>$PHP_AUTH_USER - username
>$PHP_AUTH_PW - password
>


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:17 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0