473,327 Members | 1,979 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,327 software developers and data experts.

Uploading problem to the server host ... specialy in putting a right directory

I am trying to upload .doc and .pdf files to my server host and I got this problem:
Latest I knew that the problem in the directory but I tried all the ways I know and it failed too.
Here is a problem I got and php script I use to upload
Warning: move_uploaded_file(/home/canada/public_html/CVRcieved/Nice Fomts.doc) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/canada/public_html/saas/trainingCorsesApplying.php on line 52

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpwNKdEy' to '/home/canada/public_html/CVRcieved/Nice Fomts.doc' in /home/canada/public_html/saas/trainingCorsesApplying.php on line 52

$target_path = $_SERVER['DOCUMENT_ROOT']."/CVRcieved/";
$target_path = $target_path . basename($_FILES['uploadedfile']['name']);
if($_FILES['uploadedfile']['type'] == "application/word" || $_FILES['uploadedfile']['type'] == "application/msword" || $_FILES['uploadedfile']['type'] == "application/pdf")
{
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
{
basename( $_FILES['uploadedfile']['name'])." Upload done";
else{
echo "error please try again ";
}
Jun 25 '11 #1
1 1701
this problem got solved by understanding the $_SERVER['DOCUMENT_ROOT'] works ... my php script was work inside a directory in the server host i put this and it's work fine

$cv_dir = "/CVRcieved/";
$target_path = $_SERVER['DOCUMENT_ROOT']."/saas/".$cv_dir;
  • the first line containing the name of directory where i saved files.
  • the second line containing the path to where it save.

i thought me be it help to share this tips.
Jun 25 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: jason mazzotta | last post by:
Hi, I'm rather new to both MySQL and PHP. I've been trying to use PHP to write to a MySQL database. I call mysql_pconnect to get a database connection, but then when I call mysql_db_select, I get...
0
by: Edmond Doudard | last post by:
Hi, I have just installed the MySQL ODBC driver 3.51 on an XP machine which is behind a proxy. When I configure my DSN, I can't access the MySQL server which is in the "outside" world. I...
0
by: youngeagle | last post by:
I have been trying to install the Microsoft Visual Studio.net Server Explorer Extensions for Active Directory (found at link below) and get an error that says "Server Explorer Extensions for Active...
4
by: dracolytch | last post by:
Hey gang, I'm currently using startlogic.com for my PHP/MySQL virtual server. At $20, it's hard to beat the price. Unfortunately, I'm getting more and more dissatisfied with their uptime. I...
10
by: JDS | last post by:
Hi all. I don't know if this is possible, and if it is, whether it needs to be done within Apache configuration or PHP configuration, but here goes: I am migrating my web server to another...
1
by: Jonathan Lee | last post by:
Dear all I want to program implementation scan all of the IIS host or SqlServer host in the local network. But I only can search all of computer in the local network now. And how can I determind...
2
by: Andreas Zita | last post by:
Hi I have some space on a server host where I put my asp.net applications. However I (my app) doesn't seem to have write permissions to it's folders. I want to save some log-files...
2
by: GS | last post by:
Implemented web application using MySQL to maintain inventory of the office PC's/laptops/Routers/hubs and other stuff, here we are using MySQL as back-end Database on Linux Operating system. I need...
2
by: grittyminder | last post by:
I'm posting this in the Linux forum because I think the problem lies with a linux configuration file somewhere. I recently installed request-tracker on a LAMP server for fun (Ubuntu server 7.04)....
0
by: new one | last post by:
for the code below i got error: Traceback (most recent call last): File "C:/Python26/testdb", line 6, in <module> db = MySQLdb.connect("host","testuser","test123","TESTDB" ) File...
0
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
0
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
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
0
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...

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.