Code not transferring zip file

  • Thread starter Thread starter AA2913
  • Start date Start date
A

AA2913

Guest
We are trying to compile files and upload the file as zip format to a vendors site through the URL and credentials provided by them. The URL and credentials are in the script. But the file transfer does not occur. We are running this through task scheduler on a Windows Server 2012 R2 server. There are no firewall configured for outbound or inbound. Firewall is disabled on the server.

They have an url which has /api/2/batch/profile. If I go directly to that path it gives me a 404 file not found. I added restapi/2/batch/profile and I get the following error. Server Error

404 - File or directory not found.
The resource you are looking for might have been removed, had its name
changed, or is temporarily unavailable.


This is the script file (few lines from the main script)

---------<add key="ZippedFile" value="filename.zip" />
-------- <add key="EmailHost" value="smtp.company.com" />
----------<add key="EmailPort" value="25" />
---------<add key="DateAuditsBeganInPD" value="2012-03-18" />
----------<add key="WebServiceURI"
----------value="https://companyname.com/api/2/batch/profile"/>
----------<add key="UserId" value="userID"/>
--------- <add key="Password" value="password"/>
--------- <add key="UploadResponseFile" value="UploadResponse.txt"/>
-------</appSettings>


I get no error message. The file does not get uploaded to their website. But, if we do it through CURL command and try to upload the file just through CURL command it uploads it from that server or from any desktop.

curl.exe -X POST -u "userID":"password" -H "content-type: multipart/form-
data" --form "batch-file=@\\path to the zip file\filename.zip" --url
"https://companyname.com/api/2/batch/profile"





AA2913

Continue reading...
 
Back
Top