Hi all,
I've to accept a file that is sent using a POST method.
The file will be sent using this URL: http://username:pa**@www.mysite.com/upload.php
How can I retrieve the username and passord and rename the file ? Should I
use substring using the URI ? Pseudocode below is the best way to do so ?
<?php
$user = substr($_SERVER['REQUEST_URI'],pos('//'),pos(':'));
$pass = substr($_SERVER['REQUEST_URI'],pos(':'),pos('@'));
$userid = select userid where user = $user and pass=$pass.
renamefile($_FILES['userfile']['tmp_name'],$userid)
?>
Thanks for help.Bob 5 1837
On Nov 19, 10:10 am, "Bob Bedford" <b...@bedford.comwrote:
Hi all,
I've to accept a file that is sent using a POST method.
The file will be sent using this URL:
http://username:p...@www.mysite.com/upload.php
How can I retrieve the username and passord and rename the file ? Should I
use substring using the URI ? Pseudocode below is the best way to do so ?
<?php
$user = substr($_SERVER['REQUEST_URI'],pos('//'),pos(':'));
$pass = substr($_SERVER['REQUEST_URI'],pos(':'),pos('@'));
$userid = select userid where user = $user and pass=$pass.
renamefile($_FILES['userfile']['tmp_name'],$userid)
?>
Thanks for help.Bob
The username will be in $_SERVER['PHP_AUTH_USER'] and the password
will be in $_SERVER['PHP_AUTH_PW'].
"ZeldorBlat" <ze********@gmail.coma écrit dans le message de news: f8**********************************...oglegroups.com...
On Nov 19, 10:10 am, "Bob Bedford" <b...@bedford.comwrote:
>Hi all,
I've to accept a file that is sent using a POST method.
The file will be sent using this URL:
http://username:p...@www.mysite.com/upload.php
How can I retrieve the username and passord and rename the file ? Should I use substring using the URI ? Pseudocode below is the best way to do so ?
<?php $user = substr($_SERVER['REQUEST_URI'],pos('//'),pos(':')); $pass = substr($_SERVER['REQUEST_URI'],pos(':'),pos('@')); $userid = select userid where user = $user and pass=$pass. renamefile($_FILES['userfile']['tmp_name'],$userid) ?>
Thanks for help.Bob
The username will be in $_SERVER['PHP_AUTH_USER'] and the password
will be in $_SERVER['PHP_AUTH_PW'].
argh !!! too simple...
thanks for help.
Bob
"ZeldorBlat" <ze********@gmail.coma écrit dans le message de news: f8**********************************...oglegroups.com...
On Nov 19, 10:10 am, "Bob Bedford" <b...@bedford.comwrote:
>Hi all,
I've to accept a file that is sent using a POST method.
The file will be sent using this URL:
http://username:p...@www.mysite.com/upload.php
How can I retrieve the username and passord and rename the file ? Should I use substring using the URI ? Pseudocode below is the best way to do so ?
<?php $user = substr($_SERVER['REQUEST_URI'],pos('//'),pos(':')); $pass = substr($_SERVER['REQUEST_URI'],pos(':'),pos('@')); $userid = select userid where user = $user and pass=$pass. renamefile($_FILES['userfile']['tmp_name'],$userid) ?>
Thanks for help.Bob
The username will be in $_SERVER['PHP_AUTH_USER'] and the password
will be in $_SERVER['PHP_AUTH_PW'].
In fact not soo easy...how to get the filename ?
In the case of a form, you get the control name for getting the file like
this:
$_FILES['formname']['tmp_name']
But since there is no form, what the name I've to put in place of 'formname'
?
"Bob Bedford" <bo*@bedford.comwrote:
>>> I've to accept a file that is sent using a POST method.
The file will be sent using this URL:
http://username:p...@www.mysite.com/upload.php
... In fact not soo easy...how to get the filename ?
In the case of a form, you get the control name for getting the file like this: $_FILES['formname']['tmp_name']
But since there is no form, what the name I've to put in place of 'formname' ?
If you plan to upload a file using a POST request, then your POST request
has to SIMULATE a form. The POST data will include the file's data as a
named field, just like a form would.
Only you know the name of the field, of course.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: dickiedyce |
last post by:
Hi there.
I've spent the weekend getting ever more frustrated, trying to get an
upload file function working on a website.
The site is hosted by a company called oneandone. They're using PHP...
|
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...
|
by: tshad |
last post by:
I have a page that I am using for multiple uses that includes reposting of
the page as well as going to another page where the "form" tag would be
something like:
<form id="something"...
|
by: FusionGuy |
last post by:
I've created a file uploading handler, implemented as an httpHandler. Each
time I attempt to upload a file, or files, my HttpContext.Request.Files
property never contains the files that were...
|
by: Chris |
last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL.
Meeting info and Meeting docs reside on 2 related tables in the db. Users
may want to upload anywhere from 1 to 10 or...
|
by: Fary4u |
last post by:
Hi Guys
i'm trying to upload a file, i've tried 3 different methods but still not work out i don't know how to over come this problem
hidden file value, multiple form or popup uploading.
1-...
|
by: WeCi2i |
last post by:
Okay, I have a problem that has been stumping me for weeks. I have tried many different solutions and this is pretty much my last resort. I have seen a lot of good answers give here so I figured I...
|
by: seeing |
last post by:
hello :)
i have managed to get my php to work as in, an uploader user page
1) upload.php ||| amount of files to be uploaded
<html>
<head>
<title>Upload_Amount</title>
|
by: Atli |
last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t.
In situations where your PHP application...
|
by: Piotrekk |
last post by:
Hi
My application is uploading the file to the ASP script. I am dealing
with situation where ASP script is not interested in receiving a file.
I simulate this by returning from ASP script:
...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |