473,657 Members | 2,582 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Upload files

Ken
I am trying to upload a file to an Apache2 server on Windows 2000 Pro.

The temp file name is being added to the database.

Everything seems to work except the file is not actually transferred to the
directory. I have searched the entire hard drive for the temp file name but
it is not saved.

I have tried both defining and not defining upload_tmp_dir in PHP.ini
Both directories have had share activated.

Any suggestions on what I am doing wrong?

Thanks.

Ken
-----------
Part of HTML table, input of file:
<?php
error_reporting (E_ALL);
// error_reporting (0);
session_start() ;
<form enctype="multip art/form-data" name="picture" method="post"
action="ty.php" >
<input type="hidden" name="MAX_FILE_ SIZE" value="2000000" >

<input type="file" size="68" name="pictures" ></td></tr>

------------------------
Part of ty.php
<?php
error_reporting (E_ALL);
// error_reporting (0);
session_start() ;
include('./store_data.php' );
print("Name = ".$_FILES['pictures']['tmp_name']."<br><br>") ;
echo "Did file upload = ".is_uploaded_f ile
($_FILES['pictures']['tmp_name']);

---------------------------
store_data.php
<?php
error_reporting (E_ALL);
// error_reporting (0);
session_name('w iclassifiedads' );
session_start() ;

--------------------------
Results:
Name = C:\PHP\uploadte mp\phpD5.tmp

Did file upload = 1

--------------------------------------
Insert into mysql database
mysql_query("IN SERT INTO data (published, picture1, picture2) Values('not
published','not listed', '{$_FILES['pictures']['name']}')");
Do I need to actually write script to copy the file into the directory, or
does the mysql_query perform the task?

Ken



Jul 17 '05 #1
2 1900
Ken
Additional info:

I just added
echo "Error = ".$_FILES['pictures']['error'];

Results:
Error = 0

Ken

"Ken" <kk******@wi.rr .com> wrote in message
news:gq******** ***********@twi ster.rdc-kc.rr.com...
I am trying to upload a file to an Apache2 server on Windows 2000 Pro.

The temp file name is being added to the database.

Everything seems to work except the file is not actually transferred to the directory. I have searched the entire hard drive for the temp file name but it is not saved.

I have tried both defining and not defining upload_tmp_dir in PHP.ini
Both directories have had share activated.

Any suggestions on what I am doing wrong?

Thanks.

Ken
-----------
Part of HTML table, input of file:
<?php
error_reporting (E_ALL);
// error_reporting (0);
session_start() ;
<form enctype="multip art/form-data" name="picture" method="post"
action="ty.php" >
<input type="hidden" name="MAX_FILE_ SIZE" value="2000000" >

<input type="file" size="68" name="pictures" ></td></tr>

------------------------
Part of ty.php
<?php
error_reporting (E_ALL);
// error_reporting (0);
session_start() ;
include('./store_data.php' );
print("Name = ".$_FILES['pictures']['tmp_name']."<br><br>") ;
echo "Did file upload = ".is_uploaded_f ile
($_FILES['pictures']['tmp_name']);

---------------------------
store_data.php
<?php
error_reporting (E_ALL);
// error_reporting (0);
session_name('w iclassifiedads' );
session_start() ;

--------------------------
Results:
Name = C:\PHP\uploadte mp\phpD5.tmp

Did file upload = 1

--------------------------------------
Insert into mysql database
mysql_query("IN SERT INTO data (published, picture1, picture2) Values('not
published','not listed', '{$_FILES['pictures']['name']}')");
Do I need to actually write script to copy the file into the directory, or
does the mysql_query perform the task?

Ken




Jul 17 '05 #2
You are not copying the file anywhere, so when your script finishes it's
going to delete the temporary file (or shortly thereafter). You need
something like
copy($_FILES['picture'][tmp_name'],
'C:/someOtherPlace/'.$_FILES['picture']['name']);

// Ian

"Ken" <kk******@wi.rr .com> wrote in message
news:gq******** ***********@twi ster.rdc-kc.rr.com...
I am trying to upload a file to an Apache2 server on Windows 2000 Pro.

The temp file name is being added to the database.

Everything seems to work except the file is not actually transferred to the directory. I have searched the entire hard drive for the temp file name but it is not saved.

I have tried both defining and not defining upload_tmp_dir in PHP.ini
Both directories have had share activated.

Any suggestions on what I am doing wrong?

Thanks.

Ken
-----------
Part of HTML table, input of file:
<?php
error_reporting (E_ALL);
// error_reporting (0);
session_start() ;
<form enctype="multip art/form-data" name="picture" method="post"
action="ty.php" >
<input type="hidden" name="MAX_FILE_ SIZE" value="2000000" >

<input type="file" size="68" name="pictures" ></td></tr>

------------------------
Part of ty.php
<?php
error_reporting (E_ALL);
// error_reporting (0);
session_start() ;
include('./store_data.php' );
print("Name = ".$_FILES['pictures']['tmp_name']."<br><br>") ;
echo "Did file upload = ".is_uploaded_f ile
($_FILES['pictures']['tmp_name']);

---------------------------
store_data.php
<?php
error_reporting (E_ALL);
// error_reporting (0);
session_name('w iclassifiedads' );
session_start() ;

--------------------------
Results:
Name = C:\PHP\uploadte mp\phpD5.tmp

Did file upload = 1

--------------------------------------
Insert into mysql database
mysql_query("IN SERT INTO data (published, picture1, picture2) Values('not
published','not listed', '{$_FILES['pictures']['name']}')");
Do I need to actually write script to copy the file into the directory, or
does the mysql_query perform the task?

Ken




Jul 17 '05 #3

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

Similar topics

4
2916
by: Tihon | last post by:
Hello! I again need your help, just can't understand whats going on. Got this upload pictures form and it's having problem handling large files (~1.5 - 2 MB). Everything works fine if i just upload files, like this: copy ($myfile, $uploadfolder . "/" . $myfile_name); Everything works fine, it can process large files and everything, but i need to make sure that people only upload pictures, so i change
3
11753
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
4
4474
by: Matt Jensen | last post by:
Howdy I've got a rather strange issue occuring. I used forms based .NET authentication, although I'm also setting some session variables when people login. However, I've found when people use one of my webform pages which includes a button that pops up a window where you can upload files, if you upload files in this popup window, it seems to somehow clear out all of the session variables and the users get logged out. However, if...
0
4749
by: SEMIH DEMIR | last post by:
Sitelerden birinde verilen yabancı kaynakli bir scriptti duzenledim yanlız birseyin içinden bir turlu cıkamadım işin aslı ilk defa persistin upload componentini kullanacam yanlız suanki haliyle verdiği hata şu.Bilen arkadaşlar lütfen yardım edin Persits.Upload.1 error '800a0020' The system cannot find the path specified. /classifieds/upload.asp, line 250
9
3824
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 site for a small club I belong to and one of the features I would like to include is the ability to allow users to upload image files. unfortunately the servers web root www folder only allows READ and EXECUTE permissions, which makes it...
7
3181
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file" name="file_1" size=46 /><input type=submit /> so, after adding a few files, the input fields look like this:
21
34385
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready equipped for uploading files via the CGI.pm module, which has long been a core module and allows users...
5
3278
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is _uploadedfiles_xxxx) (php must be allowed to move uploaded files to this folder' - uploadedfiles_xxxx. I typed <?php chmod ('_uploadedfiles_xxxx',640); ?> into notepad and saved it as php in the uploaded_xxxx folder, when I went to test it, the error...
4
4876
by: MoroccoIT | last post by:
Greetings - I saw somewhat similar code (pls see link below) that does mupltiple files upload. It works fine, but I wanted to populate the database with the same files that are uploaded to mydirectory, but for some reason, I am getting different file names on the database. Here is the full code: please do serach on kewword "database" to see where I added my database code - that where I need help with. And here the link where I got it...
1
5713
by: achotto | last post by:
hi, i try to upload a multiple image files. after that i will rename the files name. the problem is when i upload a 2 or more same files name exp-goal.jpg, it will return "files already exist". ok this is my codes, Set Upload = Server.CreateObject("Persits.Upload.1") Count = Upload.Save("d:\cmsupload\cimg\") for each File in upload.Files ' '...sme operation here..
0
8392
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8503
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,...
0
8605
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7324
agi2029
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...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
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...
1
2726
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
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
bsmnconsultancy
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...

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.