473,387 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Receive file and save or echo the content

Hello group members,

I want to send a file "a.b" and I want server to save this file on the
server in
filename "abcde" then I will send the file content as buffer and
include the following
header

Content-Disposition: attachment; filename=abcde;

and if I want to send a stream I will have the following header

Content-Disposition: inline

I want the server to echo the content of the buffer and save the file
in the filename variable.

I am aware of the form interface, but I do not want the server side
script to read form data.
Instead I want to telnet to the server which can take the post request
and follow my wishes.

The following two scripts do not serve the purpose, What need I
change in these scripts so
that I can do the needful.

<?php
print_r($_POST);
?>

************** to echo the content and

<?php
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}

echo 'Here is some more debugging info:';
print_r($_FILES);

print "</pre>";

?>

**************to save the file

Thanks in advance.

nagrik

Sep 8 '06 #1
0 2998

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

Similar topics

5
by: Codeman II | last post by:
Hi there, I am building a form where the user must upload a picture and fill in his details. Now I have a problem as all of this is on the same form. How will I be able to have the Browse...
0
by: Vinay Nagrik | last post by:
Hello group members, I want to send a file "a.b" and I want server to save this file on the server in filename "abcde" then I will send the file content as buffer and include the following...
0
by: amrhi | last post by:
Hy Guys , Can anybody help me ? I try to make small web database in my unit. Some of fields have on change behaviour to get other data that automatically filled other text field. But when i try to...
4
by: sufian | last post by:
Below is the field where user enters his/her email address and the AJAX post request is sent to the server and the user sees the message: echo("<div id=\"message\" class=\"success\">Thank you! You...
4
by: robin1983 | last post by:
Hi, i got a problem while uploading a file. I got a code from www.w3schools.com. I try the code, but the problem is that, i cannot specify the path where the file should stored. If i want to stored...
2
by: robin1983 | last post by:
Hi guys, I have a data base to store some .doc file and actually i give a link in one of pages. When i click the link, i wan to show the content of the doc file in the webpages. the code is given...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
2
by: cleary1981 | last post by:
Hi, I have created a script in PHP thats generates an SVG image. Want I want to do is have PHP save this as example.svg. Can this be done? Heres my code <?php require "config.php"; $proj_id =...
1
by: cleary1981 | last post by:
Hi, I have this script for backing up a database that when it is run the option comes up to save the file. Can anyone show me how I would change this script so that the script automatically saves...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
Oralloy
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,...
0
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...

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.