Boat Drinks  

Go Back   Boat Drinks > General > Computer and Consoles

Reply
 
Thread Tools Display Modes
Old 16-10-2007, 17:51   #21
leowyatt
Chef extraordinaire
 
leowyatt's Avatar
 
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
Default

just got in from work but will have a look in a bit
__________________
"Dr Sheldon Cooper FTW!"
leowyatt is offline   Reply With Quote
Old 16-10-2007, 19:14   #22
Desmo
The Last Airbender
 
Desmo's Avatar
 
Join Date: Jun 2006
Location: Pigmopad
Posts: 11,915
Default

OK, cheers matey. I've tried all sorts of stuff but just can't get it nailed :/
__________________
Desmo is offline   Reply With Quote
Old 17-10-2007, 09:08   #23
leowyatt
Chef extraordinaire
 
leowyatt's Avatar
 
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
Default

Quote:
Originally Posted by Desmo View Post
Here's the php code I'm struggling with...

Code:
if(is_dir("/home/jmartw00/files/".$Name))
{
}
else { mkdir("/home/jmartw00/files/".$Name, 0777);
}
$image_part = " - ".$_FILES['Attachment1']['name'];
$image_list[7] = $image_part;
copy($_FILES['Attachment1']['tmp_name'], "/home/jmartw00/files/$Name".$image_part);
$image_part = " - ".$_FILES['Attachment2']['name'];
$image_list[8] = $image_part;
copy($_FILES['Attachment2']['tmp_name'], "/home/jmartw00/files/".$Name.$image_part);
$image_part = " - ".$HTTP_POST_FILES['Attachment3']['name'];
$image_list[9] = $image_part;
copy($_FILES['Attachment3']['tmp_name'], "/home/jmartw00/files/".$Name.$image_part);
I just can't get it to put the actual file into the new directory.
try that
__________________
"Dr Sheldon Cooper FTW!"

Last edited by leowyatt; 17-10-2007 at 09:12.
leowyatt is offline   Reply With Quote
Old 17-10-2007, 17:38   #24
Desmo
The Last Airbender
 
Desmo's Avatar
 
Join Date: Jun 2006
Location: Pigmopad
Posts: 11,915
Default

Still seem to be struggling :/

I guess I'll leave it as is. I at least get the name appended to the front of the file so I still know who it's from, just would have preferred it to be in a folder for neatness really.
__________________
Desmo is offline   Reply With Quote
Old 17-10-2007, 18:53   #25
leowyatt
Chef extraordinaire
 
leowyatt's Avatar
 
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
Default

i'll chat to you about it later if you like?
__________________
"Dr Sheldon Cooper FTW!"
leowyatt is offline   Reply With Quote
Old 17-10-2007, 19:33   #26
Mark
Screaming Orgasm
 
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
Default

Quote:
Originally Posted by Desmo View Post
Here's the php code I'm struggling with...

Code:
if(is_dir("/home/jmartw00/files/$Name"))
{
}
else { mkdir("/home/jmartw00/files/$Name", 0777);
}
$image_part = $HTTP_POST_FILES['Attachment1']['name'];
$image_list[7] = $image_part;
copy($HTTP_POST_FILES['Attachment1']['tmp_name'], "/home/jmartw00/files/".$Name."/".$image_part);
$image_part = $HTTP_POST_FILES['Attachment2']['name'];
$image_list[8] = $image_part;
copy($HTTP_POST_FILES['Attachment2']['tmp_name'], "/home/jmartw00/files/".$Name."/".$image_part);
$image_part = $HTTP_POST_FILES['Attachment3']['name'];
$image_list[9] = $image_part;
copy($HTTP_POST_FILES['Attachment3']['tmp_name'], "/home/jmartw00/files/".$Name."/".$image_part);
I just can't get it to put the actual file into the new directory.
Try this version. There was something important missing.

PS - I'm not sure what $image_list is for. The changes above may possibly break that. If so, I can give you a fix for that too.

Last edited by Mark; 17-10-2007 at 19:35.
Mark is offline   Reply With Quote
Old 18-10-2007, 07:39   #27
Desmo
The Last Airbender
 
Desmo's Avatar
 
Join Date: Jun 2006
Location: Pigmopad
Posts: 11,915
Default

Ahhh, I see what you've done there
Could well be it, will give it a whirl later.

I think the image_list bit is the part that lists any uploaded files in the email that is sent to me.
__________________
Desmo is offline   Reply With Quote
Old 18-10-2007, 09:25   #28
Desmo
The Last Airbender
 
Desmo's Avatar
 
Join Date: Jun 2006
Location: Pigmopad
Posts: 11,915
Default

Wohooo, with a minor bit of tweaking, my ordering is now as I wanted

Cheers for the help guys.
__________________
Desmo is offline   Reply With Quote
Old 18-10-2007, 10:26   #29
Desmo
The Last Airbender
 
Desmo's Avatar
 
Join Date: Jun 2006
Location: Pigmopad
Posts: 11,915
Default

Hmmm, next problem

Directories are being create with 755 permissions instead of 777 meaning I can't delete them via ftp. :/

I'm sure this was working properly the other day.
__________________
Desmo is offline   Reply With Quote
Old 18-10-2007, 10:34   #30
Mark
Screaming Orgasm
 
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
Default

That'll be a thing called 'umask' possibly. It's a pain the the butt for things like that.

I can't remember if that server allows you to run shell commands within PHP (Beansprout will tell you), but if it does, then adding:

system("chmod -R 777 /home/jmartw00/files/$Name");

after copying in the last of the files should sort it.
Mark is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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
Forum Jump


All times are GMT +1. The time now is 20:07.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.