>define class server as session olepublic > function sendfile(l_login as string, o_file as ??????) as string > *code to save o_file to filename > return "successful" > endfunc >enddefine >>
>define class server as session olepublic > function sendfile(l_login as string, o_file as base64Binary) as string >>The problem is I'm not sure how to specify the second parameter, then save it to file once it's brought in.
* Returns a Slice from an archive * FUNCTION GetFileSlice(tcGUID AS STRING, tcarchivo AS STRING, tnposicion AS DECIMAL, tnbuffer AS DECIMAL) AS base64Binary LOCAL lnharchivo, lcst lnharchivo = FOPEN(lcarchivo,10) IF lnharchivo <> -1 * nos vamos a EOF FSEEK(lnharchivo, tnposicion) lcst = FREAD(lnharchivo,tnbuffer) lcst = CREATEBINARY(lcst) FCLOSE(lnharchivo) RETURN lcst ELSE RETURN "-1" ENDIF ENDFUNCThis passes the file in chunks or slices to the client VFP app.
FUNCTION Fich_Bin(tcGUID AS STRING, tcarchivo AS STRING, tntamano AS DECIMAL, tcarchivost AS base64Binary) AS INTEGER LOCAL lcarchivo, lnharchivo, lnret lnret = 0 lnharchivo = FOPEN(lcarchivo,12) IF lnharchivo <> -1 * nos vamos a EOF FSEEK(lnharchivo, 0, 2) FWRITE(lnharchivo,tcarchivost) FCLOSE(lnharchivo) ELSE lnret = -1 ENDIF RETURN lnret ENDFUNC>All the examples to move pictures have been in .NET, so there's no problem actually declaring the data type in the web service. Fox doesn't have a base64 type, so it's not abundantly clear to me.