Alpha Video Training
Results 1 to 11 of 11

Thread: File.Send

  1. #1
    Member
    Real Name
    Richard A. Froncek
    Join Date
    Jun 2001
    Posts
    399

    Default File.Send

    Code:
    Dim Filelist as C
    Filelist = "C:\cdpv8\xfrorders.dbf,C:\cdpv8\xfrorders.fpt,C:\cdpv8\xfrorders.ddm,C:\cdpv8\xfrorders.ddd,C:\cdpv8\xfrorders.cdx,C:\cdpv8\xfrorders.ddx"
    File.Send(Filelist,"dickftnhls@cox.net","C","orders","New orders.",(.T.),"C:\A5Email",(.T.))
    ERROR: Variable is of different type
    Above from Interactive, same resilt in code.
    Have tried different 'flavors', but no clue what variable is the culprit.
    Flavors: quote mark variations, .T. with and without parens.
    Appears to follow the help file "File.Send"
    Dick

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: File.Send

    The last three parameters should be logical values.

    Your next to last parameter, "C:\A5Email", doesn't satisfy

    Store_in_Outbox as L

  3. #3
    Member
    Real Name
    Richard A. Froncek
    Join Date
    Jun 2001
    Posts
    399

    Default Re: File.Send

    Thank you Stan.
    Dick

  4. #4
    Member
    Real Name
    Richard A. Froncek
    Join Date
    Jun 2001
    Posts
    399

    Default Re: File.Send

    Stan, the send works fine. Now the problem is saving it where I want it. It always ends up in the db directory.

    Code:
    Filelist = "C:\cdpv8\xfrorders.dbf,C:\cdpv8\xfrorders.fpt,C:\cdpv8\xfrorders.ddm,C:\cdpv8\xfrorders.ddd,C:\cdpv8\xfrorders.cdx,C:\cdpv8\xfrorders.ddx"
    File.Send(Filelist,"dickftnhls@cox.net","Z","orders","New orders.",.T.,.T.,.T.)
    Nomen = "Orders.zip"        ' generates unique reference code
    fn = Browse.saveas("brwxfrorders","zip","","","C:\A5Email\\"+Nomen,.F.)
    Does the directory have to be set in the Settings -> Email -> Profile area? The saveas should do it but it doesn't.
    Thanks again.

  5. #5
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: File.Send

    The format parameter possibilities for the browse.saveas() function are

    "PDF"
    Adobe Acrobat PDF Format.

    Note : The PDF Printer drivers used in Version 7 will not create valid PDF files if you have created layouts that use a "percentage" as the property for the Background Fill property an object. The work around is to only use the "Solid", "Translucent" or "Transparent" option for the Background, Fill property.

    "HTML"
    Dynamic HTML

    "RTF"
    Rich Text Format

    "TXT"
    Plain Text Format
    Zip is not one of the choices. (Parameter #2)

  6. #6
    Member
    Real Name
    Richard A. Froncek
    Join Date
    Jun 2001
    Posts
    399

    Default Re: File.Send

    That's what help shows, but how do you save a zip file where you want it via xbasic?
    Dick

  7. #7
    Member
    Real Name
    Richard A. Froncek
    Join Date
    Jun 2001
    Posts
    399

    Default Re: File.Send

    DOS
    How do I get to DOS in xbasic? I can do it there.
    Dick

  8. #8
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: File.Send

    Quote Originally Posted by Richard Froncek View Post
    That's what help shows, but how do you save a zip file where you want it via xbasic?
    Dick
    There is a help file available.......

    ZIP_FILES()

    Syntax

    Result_Flag as L = ZIP_FILES( Zip_Filename as C, File_List as C [, Delete_Existing as L [, Number_of_Batches as N [, Flags as C [, Base_Path as C ]]]] )

    Argument
    Description

    Zip_Filename
    The name of the ZIP file to create or to update.

    File_List
    A CR-LF or comma, delimited list of filenames.

    Delete_Existing
    Determines whether existing files with the same name are deleted.

    .T. = The file is deleted (if it exists) before the new file is added to the zip file.

    .F. = Files are added to the existing zip file.

    Number_of_Batches
    Optional. Default = 1. The number of batches that the file list should be divided into. Each batch is added to the zip file in a single call to Alpha Five's low level zip function. The fewer the number of batches, the faster the zip operation will be. By setting the Number_of_Batches to 1, the user will get no feedback (other than an hourglass cursor) on the zip operation. If the Number_of_Batches is set to some value greater than 1, then the Status bar will show the percentage of the job that has been completed.

    Flags
    Optional. Default = "".

    "" = The zip file does not include paths of the files that are added.

    "D" = The path of each file (relative to the Base_Path ) is included in the zip file.

    Base_Path
    Optional. Default = "". A directory path.


    Description

    ZIP_FILES() is a high level utility function that add a list of files to a zip file called Zip_Filename.

    Result_Flag is .T. if all of the files listed in File_List are successfully added to the zip file. If Base_Path is blank, and Flags is "D", then the absolute path of each file is included in the zip file.

    This utility function is easier to use than the low level FILE.ZIP()method when you have to add a list of files to a zip file.

    Supported By

    Alpha Five Version 5 and Above

    Example

    The following script adds two files to a zip file.

    F1 = "C:\A5\table1.dbf"

    F2 = "C:\A5\table2.dbf"

    zipfile = "C:\A5\test.ZIP"

    filelist = f1 + CRLF() + f2

    zip_files(zipfile, filelist, .T.)


    See Also

    UNZIP_FILES(), FILE Functions and Methods
    After saving with the .saveas(), zip it up and delete the original.........

    This should work.

    Code:
    Filelist = "C:\cdpv8\xfrorders.dbf,C:\cdpv8\xfrorders.fpt,C:\cdpv8\xfrorders.ddm,C:\cdpv8\xfrorders.ddd,C:\cdpv8\xfrorders.cdx,C:\cdpv8\xfrorders.ddx"
    File.Send(Filelist,"dickftnhls@cox.net","Z","orders","New orders.",.T.,.T.,.T.)
    Nomen = "Orders"        ' generates unique reference code
    fn = Browse.saveas("brwxfrorders","pdf","","","C:\A5Email\\"+Nomen+".PDF",.F.)
    zip_files("C:\A5Email\\"+Nomen+".ZIP","C:\A5Email\\"+Nomen+".PDF",.t.)
    FILE.REMOVE("C:\A5Email\\"+Nomen+".PDF")
    Last edited by Stan Mathews; 10-19-2007 at 04:35 PM.

  9. #9
    Member
    Real Name
    Richard A. Froncek
    Join Date
    Jun 2001
    Posts
    399

    Default Re: File.Send

    Thanks again.
    Dick

  10. #10
    Member
    Real Name
    Richard A. Froncek
    Join Date
    Jun 2001
    Posts
    399

    Default Re: File.Send

    Stan, yours didn't work. This did - put it where it was supposed to go.

    Nomen = "Orders " + seller ' generates unique reference code
    fn = Browse.saveas("brwxfrorders","pdf","","","C:\A5Email\\"+Nomen + ".ZIP",.T.)
    Save_to_file("Nomen + Zip","c:\A5Email\Orders.zip",.F.)

    Dick

  11. #11
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: File.Send

    Quote Originally Posted by Richard Froncek View Post
    Stan, yours didn't work. This did - put it where it was supposed to go.

    Nomen = "Orders " + seller ' generates unique reference code
    fn = Browse.saveas("brwxfrorders","pdf","","","C:\A5Email\\"+Nomen + ".ZIP",.T.)
    Save_to_file("Nomen + Zip","c:\A5Email\Orders.zip",.F.)

    Dick
    Have you looked at what was saved?

    Your saveas statement saves a pdf file with a zip extenstion. Shouldn't be openable. The save_to_file() function is used to save a character string to a file. I don't think "c:\A5Email\Orders.zip" is a character string.

    If you find that you really have saved what you wanted, glad you got it working.

Similar Threads

  1. How do I send two different file types in one email message
    By David Montgomery in forum Alpha Five Version 8
    Replies: 5
    Last Post: 10-06-2007, 05:54 PM
  2. send mail wont send
    By Lost in forum Web Application Server v7
    Replies: 3
    Last Post: 02-28-2006, 01:20 PM
  3. What file do I send to client?
    By Wanda Tucker in forum Alpha Five Version 5
    Replies: 8
    Last Post: 04-27-2004, 09:17 AM
  4. Email send file as attachment
    By Mike O'Connor in forum Alpha Five Version 5
    Replies: 1
    Last Post: 12-25-2003, 11:44 AM
  5. Can I send my own PDF file with Report Mailer?
    By John Speredelozzi in forum Alpha Five Version 5
    Replies: 2
    Last Post: 01-24-2003, 04:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •