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($_FI LES['userfile']['tmp_name'],$userid)
?>
Thanks for help.Bob 5 1876
On Nov 19, 10:10 am, "Bob Bedford" <b...@bedford.c omwrote:
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($_FI LES['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********@gma il.coma écrit dans le message de news: f8************* *************** **...legroup s.com...
On Nov 19, 10:10 am, "Bob Bedford" <b...@bedford.c omwrote:
>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($_F ILES['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********@gma il.coma écrit dans le message de news: f8************* *************** **...legroup s.com...
On Nov 19, 10:10 am, "Bob Bedford" <b...@bedford.c omwrote:
>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($_F ILES['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.co mwrote:
>>> 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 4.2.
3, not in safe mode. I think that the basic problem is the set-up for
the temp folder, but I don't have access to the .ini settings.
I'm pretty sure it's possible, because I've got MyPHPAdmin running, and
|
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 that this is suppossed to end up as a component for others to use,
and therefore I do NOT have access to their global.cs::Session_End()
how do I cleanup files that were uploaded -- but obviously left stranded
when the users aborted/gave up writting...
|
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" runat="server">
I looked at some of the upload examples and they all seem to have the
uploading on a page by itself where the form is set to something like:
<form Method="Post" EncType="Multipart/Form-Data" RunAt="Server">
|
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 uploaded. Here's a snippet of
my handler code:
// *** BEGIN HANDLER CODE *** //
public class AutoUpload : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
|
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 more documents to share/use
during a meeting presentation. What would be the most efficient way to
approach this? This is the logic I'm currently considering:
Page 1: Meeting Information input with link to a document upload page (this
page...
| |
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-
<SCRIPT TYPE="text/javascript">
function popupform(myform, windowname)
|
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 would give it a try.
First of all, I am using Visual Studio 2005 to write my program. I am using C# .NET as the language. I am running Windows XP Professional with all service packs and updates applied.
Now, I have been trying to write a...
|
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 needs to store entire files, the preferred method is to save the file onto the server’s file-system, and store the physical location of the file in your database. This is generally considered to be the easiest and fastest way to store files.
...
|
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:
protected void Page_Load(object sender, EventArgs e)
{
return
}
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |