Jump to content

Path Problems


ballouta

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.