Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need help sending uploaded files to a subfolder
Old 05-30-2009, 02:09 PM Need help sending uploaded files to a subfolder
Novice Talker

Posts: 6
Name: Danielle
Trades: 0
Hi so GoDaddy needs me to give my folder permissions to accept files so I needed to create a subfolder in my directory: papers. Here is my code for uploading files, where do I add that it needs to go into the papers folder first?

$paperTMP= $_FILES['paper']['tmp_name'];
if(is_uploaded_file($paperTMP)){
if($_FILES['paper']['type']== "application/msword"){
//creating folder
while (1){
$folder= rand(1000,1000000);
$result= mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM `jobs` WHERE `folder` = $folder"));
if ($result[0] == 0) {
break;
}
}
mkdir($folder);
chmod($folder, octdec('0666'));
$paper= $_FILES['paper']['name'];
move_uploaded_file($paperTMP,$folder."/".$paper);

Thanks for your help!
dfez44 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-31-2009, 03:35 AM Re: Need help sending uploaded files to a subfolder
nayes84's Avatar
Extreme Talker

Latest Blog Post:
Difference between ASP And JSP
Posts: 232
Name: John
Location: Tokyo
Trades: 0
sorry can't understand your problem? is the code you posted working? or have some problem and you need to fix it?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

if(I'm("Helpful")) Add_Talkupation("nayes84");
nayes84 is offline
Reply With Quote
View Public Profile
 
Old 05-31-2009, 10:42 AM Re: Need help sending uploaded files to a subfolder
Novice Talker

Posts: 6
Name: Danielle
Trades: 0
sorry, yeah the code I have works sending it to the root folder, but i had to create a subfolder called papers in order to give it permissions to accept files. I am just not sure how to do that in the code I have.
dfez44 is offline
Reply With Quote
View Public Profile
 
Old 05-31-2009, 10:43 AM Re: Need help sending uploaded files to a subfolder
Novice Talker

Posts: 6
Name: Danielle
Trades: 0
As in I'm not sure how to send it to the subfolder 'papers' instead of the root
dfez44 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need help sending uploaded files to a subfolder
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22232 seconds with 12 queries