I have a page (html&php)from this page post this action to
<form method=post action="loadfile.php" ENCTYPE="multipart/form-data
well the loadfile.php is a script for upload file to the mysql data base and this is the code for loadfile.php - <?php $fold=$_REQUEST['fname'];$title=$_REQUEST['title'];$uploadedfile=$_REQUEST['uploadingfile']; $host="localhost";$user="";$pass="";$dbid="upload";$link=mysql_connect($host,$user,$pass);mysql_select_db($dbid); $path="hi/". $_FILES['uploadingfile']['name'];echo $path; move_uploaded_file($_FILES['uploadingfile']['tmp_name'],$path); mysql_query("insert into loading(folder,title,fileload) values('$fold','$title','$path')"); mysql_close($link); ?><?php
-
-
$fold=$_REQUEST['fname'];
-
$title=$_REQUEST['title'];
-
$uploadedfile=$_REQUEST['uploadingfile'];
-
-
$host="localhost";
-
$user="";
-
$pass="";
-
$dbid="upload";
-
$link=mysql_connect($host,$user,$pass);
-
mysql_select_db($dbid);
-
-
$path="hi/". $_FILES['uploadingfile']['name'];
-
echo $path;
-
-
move_uploaded_file($_FILES['uploadingfile']['tmp_name'],$path);
-
-
mysql_query("insert into loading(folder,title,fileload) values('$fold','$title','$path')");
-
-
mysql_close($link);
-
-
-
?>
i want to change this code and make it upload to folder like (my upload
) on the hard disk folder's (www)
in the same thing i want to make download to my hard disk from new file named (mydownload) and this is folder existing where (appserv) already installed (www) folder
i hope to accept my best regards and best wishes
want to change this code and make it upload to folder
Is it not a simple case of changing $path - move_uploaded_file($_FILES['uploadingfile']['tmp_name'],$path);
Not sure what you mean here
in the same thing i want to make download to my hard disk from new file named (mydownload) and this is folder existing where (appserv) already installed (www) folder
But it sounds like you will need FTP functions
6 1661
want to change this code and make it upload to folder
Is it not a simple case of changing $path - move_uploaded_file($_FILES['uploadingfile']['tmp_name'],$path);
Not sure what you mean here
in the same thing i want to make download to my hard disk from new file named (mydownload) and this is folder existing where (appserv) already installed (www) folder
But it sounds like you will need FTP functions
thank u code green to replay and i hope u to continue with me
my question is : what the loadfile.php cotained and how i can to write the right
script that make this operation,,,,
my second question was : i have hyperlink for download and when click on the hyperlink download started not to data base but to any place on my computer and then showed to some description about the file like (size,type,name)
what the loadfile.php cotained and how i can to write the right
script that make this operation
PHP has good file operation functions. file_get_contents() will read a file to a string which is the simplest way to output to a browser
i have hyperlink for download and when click on the hyperlink download started not to data base but to any place on my computer
To move a file you simply rename it with - rename (string $oldname,string $newname)
thank you code green to reply again
but please my question was : - <?php $fold=$_REQUEST['fname'];$title=$_REQUEST['title'];$uploadedfile=$_REQUEST['uploadingfile']; $host="localhost";$user="";$pass="";$dbid="upload";$link=mysql_connect($host,$user,$pass);mysql_select_db($dbid); $path="hi/". $_FILES['uploadingfile']['name'];echo $path; move_uploaded_file($_FILES['uploadingfile']['tmp_name'],$path); mysql_query("insert into loading(folder,title,fileload) values('$fold','$title','$path')"); mysql_close($link); ?><?php
-
-
$fold=$_REQUEST['fname'];
-
$title=$_REQUEST['title'];
-
$uploadedfile=$_REQUEST['uploadingfile'];
-
-
$host="localhost";
-
$user="";
-
$pass="";
-
$dbid="upload";
-
$link=mysql_connect($host,$user,$pass);
-
mysql_select_db($dbid);
-
-
$path="hi/". $_FILES['uploadingfile']['name'];
-
echo $path;
-
-
move_uploaded_file($_FILES['uploadingfile']['tmp_name'],$path);
-
-
mysql_query("insert into loading(folder,title,fileload) values('$fold','$title','$path')");
-
-
mysql_close($link);
-
-
-
?>
that scrip exist in the loadfile.php and that script let me upload the files from my page on (loacalhost) to mysql,,,,
how i can change it and make it upload not to mysql but to other place like(new folder on desktop)
how i can change it and make it upload not to mysql but to other place like(new folder on desktop
Well I have already suggested FTP and rename().
What do you mean be 'change it'.
thank u it's it is clear right now
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Aaron |
last post by:
On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy
protection). When a visitor clicks on the link I want them to see
my_vacation_pic.jpg (fetch realname from database) is...
|
by: k.mitz |
last post by:
Hi,
I have a PHP application that allows users to generate a .pdf report of
their database content. Normally, I've had to refresh a page to call
the script to generate the report, so there's a...
|
by: Ryan Taylor |
last post by:
Hello.
I am trying to upload a file and save it in a Sql Server 2000 database. This
seems to be working fine. However, when I download the file from SQL Server,
it appears that the page that is...
|
by: TC |
last post by:
Hello All,
I apology for posting to many groups but I wasn't sure which group would be
best targeted with my question.
I have inherited an ASP.Net application that requires some maintenance &...
|
by: Daniel |
last post by:
Hi,
can u explain to me what is the path need to use in order to upload and
download the file based on below solution:
1.Set up a folder that both the web app and SQL server can get to.
2.Do a...
|
by: Wayne Smith |
last post by:
I've come up against a major headache that I can't seem to find a solution
for but I'm sure there must be a workaround and I would really be grateful
of any help.
I'm currently building a web...
|
by: abhanjee |
last post by:
Hello,
I am a newbie and am developing an application for work.
I have figured out how to upload a file attachment to the SQL database
and download the same file using C# and Visual Studio....
|
by: =?Utf-8?B?SHVzYW0=?= |
last post by:
Hi EveryBody:
I'm working with project in my company by using ASP.Net 2.0 that allow the
users to upload and download files to web site in the internet as backup. The
user will first upload his...
|
by: KevinADC |
last post by:
Note: You may skip to the end of the article if all you want is the perl code.
Introduction
Many websites have a form or a link you can use to download a file. You click a form button or click...
|
by: chennaibala |
last post by:
can any one send me mutiple image upload program and save the file name with extension in mysql table.we must cheak uploaded file type like bmp or any image file while uploading.
i develop...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |