Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
STRTOFILE() problem
Message
 
 
To
11/05/2002 19:08:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00655277
Message ID:
00655496
Views:
31
Larry,

This works fine for me:
create table memotest1 ( cfilename c(50), m1 m nocptrans )
append blank
lcfile = "C:\My Documents\apollo 11 flag.jpg"
replace cfilename with justfname( lcfile ), m1 with filetostr( lcFile )
append blank
lcfile = "C:\WINDOWS\Desktop\Clear 10 Hurdles to Web Services Success.eml"
replace cfilename with justfname( lcfile ), m1 with filetostr( lcFile )

scan
   strtofile( m1, justfname( cFileName ) )
endscan
the code above will copy the file into the memo and then write them back out to the current directory. After running it I can double click the two new files. The JPG properly opens in IE and the EML opens up in the OE mail window.

Once you've put something into a general field, other binary data is wrapped up with the file content, so once a file has been put into a general field you will not be able to get it back out, except via a SaveAs operation of the client application it's attached to.

>I get it in, but when I try and get it back out, I lose it's contents. I tried strtofile() to hopefully recreate the email into it's original state.
>Result is the same as a general field
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform