Alpha Video Training
Results 1 to 4 of 4

Thread: File Upload - User Defined - Unique

  1. #1
    Member
    Real Name
    Wayne
    Join Date
    Aug 2009
    Posts
    129

    Default File Upload - User Defined - Unique

    I am doing a user defined file upload. I want to make each document uploaded unique. I have two columns in my SQL back end. One for the true file name, the other for the file name the user sees. For the true file name (the fully qualified name and location of the file, I am stamping some data into the name to make it more unique and less likely that the user would ever be able to upload a file of the same name that already exists.

    Here is what I have so far that builds the name of the single fully qualified filename as one string:

    fn = "C:\A5Webroot\QERP\Documents" + chr(92) + (convert_type(e.primaryKeyArray[1],"N")) + e.fileArray[i].fileName

    I then call fn and insert it into my filename column in a SQL call back.

    This works great. Would like to however stamp the numeric current time into the string as well. With this, I have the filename, Primary key of the table, and then the numeric time (or some other unique name) in the filename string. Is there a e.currenttime, etc available to call into my xbasic function?

    In the simple file upload function, there is an option to "rename" if the file exists. With the user defined advanced version, it is not apparent to me on how to select that. So, my above string is attempting to keep each file unique and avoid inevitable issues when users upload different files all named book1.xls onto the server, etc.
    Thanks
    Last edited by qcorporation; 10-17-2010 at 11:30 PM.

  2. #2
    Member
    Real Name
    Wayne
    Join Date
    Aug 2009
    Posts
    129

    Default Re: Filed Upload - User Defined - Unique

    Update*****

    Solved it by using ctime(now()) in my string function that built the filename string. ctime as I learned by a few hours of trial and error took the now() and converted it to a nice easy to get along with integer.

    For all those who come after me in this: make sure the filename column in your backend DB is large enough to handle a fully qualified file name.

  3. #3
    Member
    Real Name
    Omar Garcia
    Join Date
    Jun 2006
    Location
    Alamo, Texas
    Posts
    582

    Default Re: File Upload - User Defined - Unique

    api_uuidcreate()

  4. #4
    "Certified" Alphaholic mmaisterrena's Avatar
    Real Name
    Mauricio Maisterrena
    Join Date
    Nov 2006
    Location
    Torreon, Mexico
    Posts
    1,435

    Default Re: File Upload - User Defined - Unique

    Cheers
    Mauricio


Similar Threads

  1. File Upload - User Defined Action
    By omagarc in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 10-07-2010, 03:15 PM
  2. Upload File Feature Pack Not Showing Upload Page
    By ogmcheck in forum Application Server Version 10 - Web/Browser Applications
    Replies: 4
    Last Post: 09-01-2010, 08:10 PM
  3. User Defined functions - Not an executable file error
    By moiola in forum Application Server Version 9 - Web/Browser Applications
    Replies: 4
    Last Post: 04-25-2009, 07:50 AM
  4. User-defined Fields?
    By WesOlfert in forum Alpha Five Version 5
    Replies: 13
    Last Post: 03-01-2005, 11:25 AM
  5. looking at a user defined function
    By David Longcor in forum Alpha Five Version 4
    Replies: 3
    Last Post: 01-29-2001, 08:03 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
  •