our users copy documents form from their local pc to our server using file_copy2 function.
i cant use the name the users have given to their documents
so i have designed the script so that the document gets renamed as it is copied to meet our compliance requirements.
i have this working fine but because i have specified what the document will be called i also specified the file extension.
so at present i can only get my users to upload .pdf to our server.
i did think about trimming the last 4 characters from the field which holds the path of the document to be copied and put this in a variable and then replace the hard coded .pdf with this variable.
firstly i couldnt find how to trim the last 4 characters and secondly some of our documents are delivered to us in .html so i would need to trim 4 or 5 characters.
or is their another way to identify the document type to be copied and apply the file exension to the renamed document.
here is the code
thanks
richard
i cant use the name the users have given to their documents
so i have designed the script so that the document gets renamed as it is copied to meet our compliance requirements.
i have this working fine but because i have specified what the document will be called i also specified the file extension.
so at present i can only get my users to upload .pdf to our server.
i did think about trimming the last 4 characters from the field which holds the path of the document to be copied and put this in a variable and then replace the hard coded .pdf with this variable.
firstly i couldnt find how to trim the last 4 characters and secondly some of our documents are delivered to us in .html so i would need to trim 4 or 5 characters.
or is their another way to identify the document type to be copied and apply the file exension to the renamed document.
here is the code
Code:
'get document to be uploaded to server dim vdsupload as c vdsupload = alltrim(target->doc_browse) 'dim variables for valaues from document store form dim GLOBAL vdsfileloc as c dim GLOBAL vdsclient as c dim GLOBAL vdscaseref as c 'create document path for document to be saved to dim vdsdocpath as c vdsdocpath = trim(vdsfileloc)+"\\"+trim(vdsclient)+trim(vdscaseref) ' create variables for trimmed values from current form to be used in the document name dim vdscat as c dim vdsprov as c dim vdsdocname as c vdscat = alltrim(target->doc_cat) vdsprov = alltrim(target->doc_provider) vdsdocname = alltrim(target->targetname) ' now create full document name dim vdsdoc as c vdsdoc = vdscat+ " " +vdsprov+ " " +vdsdocname+" "+dtoc(date(),"1-")+".pdf" ' now create full drive path and document name and save to specified location file.copy2(vdsupload,vdsdocpath+"\\"+vdsdoc) 'Set 'Value' property of 'Target' in Form 'Document_Add' . parentform:Target.value = vdsdocpath+"\\"+vdsdoc
richard
Comment