Jump to content

unzipped files from windows to imac


homer.favenir

Recommended Posts

hi,

i successfully make a script that compressed a file in the server and decompressed it to the client's desktop, in windows.

but when i used a mac, it cant see the uncompressed files, but when i connect to mac using windows, i can see it.

i cant see the decompressed files in mac but in windows i can see it.

 

here is my script

<?php
require("connections/cn.php");
require("phplib/adtraqlib.php");
require("phplib/unzip.php");
session_start();
if  (!isNullorEmpty($_GET['variable'])){
$var = $_GET['variable'];
}
if  (!isNullorEmpty($_GET['nextstat'])){
$nextstat = $_GET['nextstat'];
}
if  (!isNullorEmpty($_GET['currentstatus'])){
$Currentstatus = $_GET['currentstatus'];
}
$artid = $_GET['artid'];
$artid = $artid.".zip";
$zipFile = "\\\\asecasiagsd\\AGS\\AGS\\WIP\\RECSCHART\\".$artid;
$source = "\\\\asecasiagsd\\AGS\\AGS\\WIP\\RECSCHART\\".$_GET['artid'];
// the name they save as can be different to the existing file
//check if file exist
if(!is_dir($source))
{
    die('Error: File not found.');
}
     $zip = new ZipArchive;
     if ($zip->open($zipFile, ZIPARCHIVE::CREATE ) === TRUE) {
$folder = $source;
$folder = scandir($folder);
foreach($folder as $files){
	if($files == "." || $files == ".."){
		//do nothing
	}else{

		$zip->addFile($source."\\".$files, $files);
		//echo $files."<br>";
		//echo 'my-archive/'.$files."<br>";
	}
}
$zip->close();
	//then send the headers to foce download the zip file

    //echo 'ok';
} else {
    die("Failed Archiving");
}
//extract zip files to client
//$destination = "\\\\".$_SERVER["REMOTE_ADDR"]."\\adtraq_extracted\\".$_GET['artid'];
$destination = "\\\\192.168.200.104\\scadmin\\Desktop\\".$_GET['artid']; // this is the address to the mac
unzip_file($zipFile,$destination);
//update receiving table
$ftpartID =  $_GET['artid'];
$clientDownloadReturnMsg = "";
if (!isNullorEmpty($ftpartID))
{
	//compress(ReturnSourceFilePath($ftpartID),ReturnSourceFilePath($ftpartID));
	$strfilepath = "";
	$strfilepath = ReturnSourceFilePath(str_replace(".zip","",$ftpartID) . ".zip"); //ReturnSourceFilePath expects artid.zip  format

	if (checkfilesize($strfilepath))
	{
			//insert random delay
			sleep(mt_rand(1, 5));
			$clientDownloadReturnMsg =  AcquireArticleAttempt($ftpartID);
			//echo $clientDownloadReturnMsg;
			if (substr_count($clientDownloadReturnMsg,"SUCCESS:") > 0 )
			{
				//ownership acquired and set, proceed to download
				//insert receords to tbl_transactions
				$query_insert = "insert into tbl_transactions (artid, transcode, dtestarted, StartedBy, CustomerID, prevstatus, RecordID) values('$AdID', '$nextstatus', now(), '$_SESSION[userid]', '$_SESSION[customerID]', '$Currentstatus', '$var')";
				$result_insert = mysql_query($query_insert);
				//$clientDownloadReturnMsg = $clientDownloadReturnMsg . FtpDownloadToClient($ftpartID,0);
			}
	} 
}
unlink($zipFile);
header( 'Location: artist_page.php' );
?>

 

anyone please...TIA

Link to comment
https://forums.phpfreaks.com/topic/176947-unzipped-files-from-windows-to-imac/
Share on other sites

ok, the zip file is in the server, and the client who is connecting to the server is using mac.

what does my script do is it decompress the zip file going to the client's mac.

 

server->zip file->unzip->mac's desktop

 

it made a folder, but it has no files in it. and when i use windows to connect to the mac, i can see the files.

 

 

 

 

 

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.