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 Quote Link to comment 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/"; Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
ballouta Posted June 12, 2008 Author Share Posted June 12, 2008 please help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.