HTTPS URL redirection

No more questions - please go to http://www.syncovery.com/forum instead

Moderator: SuperFlexible Administrators

HTTPS URL redirection

Postby lghmed on Mon Jun 18, 2018 9:05 am

I am trying to upload a file to an HTTPS server. I have a specific URL to upload the file to which includes a specific subfolder to drop the file in. This path is in the Syncovery profile. When I try to log in the HTTPS server appears to automatically redirect to a specifc login URL. Syncovery then says URL "redirection is not supported". Is there any way to get around this so it logs in first and then uploads to the correct subfolder?
lghmed
 
Posts: 11
Joined: Wed Nov 13, 2013 2:49 pm

Re: HTTPS URL redirection

Postby superflexible on Mon Jun 18, 2018 12:29 pm

Uploading via generic HTTP is not possible in Syncovery 7 (only via specific APIs such as Google Drive).

In Syncovery 8, uploading is done via HTTP POST requests.

However, the profile itself needs a URL that it can scan first. You could use a dummy URL if you don't want Syncovery to look for existing (previously uploaded) files.

The upload URL has to be given via a PascalScript hook (see the Job tab sheet) such as the following. More detailed help would be possible if you send a sample upload URL for testing to support@syncovery.com.

function OnHttpPost(const RelativePath: UnicodeString;
var URL, MIMEType, Header: AnsiString;
var LAsForm: Boolean;
var LFormData: AnsiString;
const Connector, Profile: Opaque):Boolean;
begin
URL:='http://upload.url/newfile';
Header:='Authorization: Bearer xyz';
LAsForm:=false;
MIMEType:='image/jpeg';
Result:=true;
end;
User avatar
superflexible
Site Admin
 
Posts: 2478
Joined: Thu Dec 31, 2009 3:08 pm

Re: HTTPS URL redirection

Postby lghmed on Tue Jun 19, 2018 3:24 pm

I put your sample script into the PASCAL window and modified it with the URL I am trying to upload to. This appears to work fine. Thanks.
lghmed
 
Posts: 11
Joined: Wed Nov 13, 2013 2:49 pm

Re: HTTPS URL redirection

Postby superflexible on Wed Jul 11, 2018 11:10 am

Hello,
we have fully released Syncovery 8 today.

Please note that the function declaration has been changed. The "Profile" parameter has been removed, so that line looks like this:
const Connector: Opaque

The PascalScript must be changed accordingly.

The whole function header now looks like this:

function OnHttpPost(const RelativePath: UnicodeString;
var URL, MIMEType, Header: AnsiString;
var LAsForm: Boolean;
var LFormData: AnsiString;
const Connector: Opaque):Boolean;
User avatar
superflexible
Site Admin
 
Posts: 2478
Joined: Thu Dec 31, 2009 3:08 pm


Return to Windows Support * new forum: www.syncovery.com/forum

cron