ballouta Posted June 12, 2008 Share Posted June 12, 2008 Hi I have this variable: $SaveFileDirectory = "/home/sitename/public_html/$user"; ..then code here process the received email, it should copy the attached file to a specific directory.. at the end the code is: foreach ($attachment as $attach) { WriteToFile($SaveFileDirectory . $attach['filename'], imap_base64($attach['filedata'])); echo "Attachment found: " . $attach['filename'] . "<br><hr>"; $myf=$attach['filename']; } When I added $user to the above path, the file name is chaning automatically when it is copied. e.g.: userFile.zip instaed of File.zip which I don't want! How i can solve this? thanks Link to comment https://forums.phpfreaks.com/topic/109914-path-problems/ Share on other sites More sharing options...
GingerRobot Posted June 12, 2008 Share Posted June 12, 2008 Your description was pretty hard to follow, but it sounds like you need a forward slash after $user: $SaveFileDirectory = "/home/sitename/public_html/$user/"; Link to comment https://forums.phpfreaks.com/topic/109914-path-problems/#findComment-564001 Share on other sites More sharing options...
ballouta Posted June 12, 2008 Author Share Posted June 12, 2008 Hi Ginger thanks it is working now, the slash was missed. more similar question please, I have this function that uncompresses a Zip file. It is working properly when I am writing the file compressed file name without a path before. e.g.: file.zip When editing the path to: $archive = new PclZip('/home/sitename/public_html/stk/$user/$myf'); or $archive = new PclZip(/stk/$user/$myf'); the functions says that the file is missing. Note that both the 'stk' and '$user' directory already exisit. Please Help Link to comment https://forums.phpfreaks.com/topic/109914-path-problems/#findComment-564016 Share on other sites More sharing options...
ballouta Posted June 12, 2008 Author Share Posted June 12, 2008 please help Link to comment https://forums.phpfreaks.com/topic/109914-path-problems/#findComment-564272 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.