Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drop file on a form for app to save it
Message
 
 
To
13/03/2018 11:18:25
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01658695
Message ID:
01658708
Views:
41
>>If I may ask you to help me understand something, please.
>>
>>Your line of code:
>>
>>
>>STRTOFILE(FILETOSTR(m.SourceFile), m.DestinationFile, 0)
>>
>>
>>The SourceFile that is dropped on the form is a PDF file, which if I understand correctly, a binary file. Does it means that FILETOSTR() will get the file into a string even if it is a binary file? (I thought that FILETOSTR() only works on Text files).
>
>FILETOSTR() and STRTOFILE() do not interfere with the file contents (although you can ask SRTTOFILE() to add a Byte-Order-Mark for UNICODE files, it requires that the string contents be already properly encoded). So, it's safe to use them to manipulate binary information.
>
>The reason I use the pair of functions instead of a single COPY command is to preserve the case of the filenames.

Thank you for clarifying. And it is nice to know that COPY would work too. So, when I add this feature to my program, I will probably let the user decide if he/she wants to copy the file as is (without changing the name); or copy it with a new name.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform