06-05-2018 12:50 PM - edited 06-05-2018 01:01 PM
Hi! Hoping someone can get me over the last hurdle...
I need to pull a file from FTP and PLACE it in a Sharepoint directory
Got the FTP part done and the file copies to my local SAS directory.
Im stuck getting it out to the sharepoint. Ive tried to use Samba, and it completes (with no errors) but doesnt actually work
So I tried using PROC HTTP but its unable to find valid certification path to requested target
Im guessing it might be the url (i will xxx some parts out)
FILENAME req "CID.csv"; FILENAME resp "TEST.CSV"; PROC HTTP URL="https://eng.sharepoint.xxxxx.com/Access/Access%20Mng%20%20Inv/Forms/Allitems.asp" METHOD="POST" IN=req CT="application/JSON" OUT=resp WEUSERNAME="loginname"
So im thinking its not connecting/authorizing correctly. prob wrong URL? (I copy/pasted from the sharepoint view)
FYI I found that code somewhere
PS: I just found a post about using cURL ... I will look into that as well
06-06-2018 08:14 AM - edited 06-06-2018 09:25 AM
Thats what i thought. I can map to it, "open with explorer", and copy to it that way... yet I try Samba and it doesnt work. Unless maybe im not getting the settings correct. I use Samba for copying to our share drives... maybe its a little different?
in windows its:
https://eng.sharepoint.company.com/Access/Access Sub folder Name/Subfolder
so In Samba I did:
X "cd /home/myname/CID; &SAMBA //eng.sharepoint.company.com MyPassWord -U MyUserName -D 'Access\ Access Sub folder\subfolder' -c 'prompt; put &FNAME'";
- I was just told that it may be a network issue as the Sharepoint is on a different server from SAS and does not allow some connections...
06-06-2018 07:09 PM
A UNC path looks like this: \\server\share\subfolders
If you have such a path, check that the SAS server can access it by running:
filename DIR pipe "dir ""\\server\share\subfolders"" /s ";
Replace the dir command by your own connection command to see what the OS returns.
If the path is accessible, the function fcopy() should do the trick.
If the only access is http, then this method is not usable obviously.
06-07-2018 08:46 AM
Well after hours of testing, trying, and pulling out my hair, it seems that It cannot be done this way on our systems. The Sharepoint system is locked down from any connection outside that network. Turns out we are setting up a system to be able to email the file to the folder in sharepoint... so Thanks for your help! I guess I just have to wait for now.