Jump to content

Recommended Posts

Posted (edited)

Righty, change the content of the file to this:

 

$smb_cfg=new stdClass;
$smb_cfg->cfgWebserverType='windows'
//$smb_cfg->cfgUserPrefix='LLANGEFNI/'; 
$smb_cfg->cfgWinShareToSmb=array(
'\\llangefni-dc'=>'LLANGEFNI/llangefni-dc'
);


$smb_cfg->cfgWinShares=array(
   'share1'=>array(
       'share'=>'LLANGEFNI/llangefni-dc/Staff Drive', 
       'title'=>'Staff Shared Area',
	'courses'=>array(1)
   ) 
);

$smb_cfg->cfgAllSharesSite=true;
$smb_cfg->cfgAnonymous = false;
$smb_cfg->cfgForceDownloads = true;
$smb_cfg->cfgMaxFolderZipSizeMB=0;
$smb_cfg->cfgCachePath = false;
$smb_cfg->cfgDefaultLanguage = 'en';
$smb_cfg->cfgDefaultCharset = 'ISO-8859-1';
$smb_cfg->cfgDefaultServer = 'localhost';
$smb_cfg->cfgSmbClient = 'C:\cygwin\bin\smbclient';
$smb_cfg->cfgAuthMode = 'SMB_AUTH_ARG_WIN';
$smb_cfg->cfgModRewrite = false;
$smb_cfg->cfgHideDotFiles = true;
$smb_cfg->cfgHideSystemShares = true;
$smb_cfg->cfgHidePrinterShares = true;
$smb_cfg->cfgLogLevel = 2;
$smb_cfg->cfgFacility = LOG_DAEMON;
$smb_cfg->cfgUserAuth = 'BasicAuth';
$smb_cfg->cfgSessionName = 'SMBWebClientID';
$smb_cfg->cfgAntivirus = false;
$smb_cfg->cfgArchiver = 'zip';
$smb_cfg->cfgInlineFiles = false;
$smb_cfg->cfgHomeDirField = '';
$smb_cfg->cfgIEProtectMsOffice=true;
$smb_cfg->cfgssl=false;
$smb_cfg->cfgSkipNoPwdParam=true;
?>

Edited by Marci
Posted

Just a query - you say your FQDN is llangefni.anglesey.sch.uk

... now, is that your ActiveDirectory domain, or your website address domain...?

Posted

ive updated with the above, still the same

 

its both the internal FQDN and the website

 

llangefni-dc.llangefni.anglesey.sch.uk is valid internally but not eternally

www.llangefni.anglesey.sch.uk and Ysgol Gyfun Llangefni are valid internally and externally

 

i normally use domain/(username) to connect if im not on a domain machine and need access to shared folders.

 

smbclient is on llangefni-email the webserver that hosts www and moodle, its under the same path as in the config and works within cmd prompt.

Posted

i got it working :), turns out i didn have the right permissions set on cmd.exe

 

do you know of any modification/way of me allowing it to download files that have spaces in the names?

Posted

No issues here with downloading docs with spaces in the names...

How are you downloading Office Docs, by left clicking, or by right clicking and using save target as...?

Posted
im firefox i can use either, in explorer i have to right click, it downloads text files fine but i get corruption on any files with formatting and fails with files with spaces, is passess a space as a + so it cant find the file to download
Posted
ive fixed the formatting bug by overighting the files in the smb folder with a new copy, there was a fault somwhere, still got the spaces issue though, im very close now, its annoying me its not working right
Posted
the more i dig into this the more im finding, ive now got a bug with uploading, it creats the file but dosnt actually put any data in it so i get a file that is 0kb in size and it can take a long time for it to upload this 0kb file, am i doing something wrong?
Posted
Couldn't say fella - we host ours on FreeBSD rather than Windows... all works perfectly out of the box for us. Do you have a firewall / ISA server between yourself and the webserver or the webserver and the fileserver?
Posted
we do, though i have tried it with and without the firewall on, still the same, its like its not waiting for the file to finish tranfering befor it finishes, im not getting errors in my logs, it could be something to do with cygwin/windows, i dont think there is another plugin like this around, when we eventually migrate to virtual servers i think ill set up a linux box for our websites.
Posted

ive got it working :), turns out it was a fault either in the php version i have installed 5.2.9-2 or in the way the code was written to work on windows, not sure, i had to re write a bit of the _SMBCLIENT function to get it to understand double quotes. annoying problem but sorted now :),

 

also fixed my file uploads, moodle itself uses a temp folder in the moodledata folder that it has read/write access to, this script uses the default temp folder for the os that it didnt have read/write to and i couldnt set it either, kept beeing overitten.

i set the php.ini temp folder to a new location within the php folder and set the correct permissions and it worked :)

 

ive added the modified file to this post so anyone else has this same problem i have found.

 

here is the file :)

class_smbwebclient.zip

  • 2 weeks later...
Posted

im getting a slight annoyence with this now, everything works but for some reason ocasionally cmd will fail to let go of the script, if enough fail it wont run again till i run iisreset, and then it is more than happy to work.

 

cmd is set up for read access from th iis user only

 

thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...