Alpha Video Training
Results 1 to 5 of 5

Thread: Uploading Photos.

  1. #1
    Member
    Real Name
    Robert Swanson
    Join Date
    Sep 2005
    Location
    Burlington, ON. Canada
    Posts
    216

    Default Uploading Photos.

    Can photos be uploaded and inserted in a field in a database by the person accessing the website?

  2. #2
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,682

    Default RE: Uploading Photos.

    This is not possible with version 6. V7 adds file upload capabilities.

    -Lenny

  3. #3
    Member
    Real Name
    Robert Swanson
    Join Date
    Sep 2005
    Location
    Burlington, ON. Canada
    Posts
    216

    Default RE: Uploading Photos.

    I couldn't find a great deal of info in the V7 documentation
    Also I found a piece of code that will allowme to resize any photo to the correct size after uploading.

    I still would like to know the procedure for uploading a photo please.

  4. #4
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,682

    Default

    Quote Originally Posted by Robert Swanson
    I still would like to know the procedure for uploading a photo please.
    The file upload is not yet a part of components, so you will have to manually code a page to do this. The code below is an A5W page that allows the user to choose a file fromt heir hard drive to upload. That file is then uploaded and placed in the webroot and can be downloaded by anyone else. This could be easliy extended to instead put the data in your table if you wish.

    Code:
    <html>
     <%a5
     dim msg as c = ""
     if eval_valid("cmd")
     	file.from_blob(ServerSetting.Document_Root + "\\" + FileToUpload.filename,FileToUpload.data)
     	msg = "<a href=\"/" + FileToUpload.filename + "\" target=\"_blank\">" + FileToUpload.filename + "</a> was uploaded<br /><br />"
     end if
     %>
     <head><title>File Upload example</title></head>
     <body bgcolor="#ffffff")
     <%a5 ? msg %>
     <form action="fileupload.a5w" method="POST" enctype="multipart/form-data">
     <input type="file" name="FileToUpload" value=""><br />
     <input type="submit" name="cmd" value="Upload File">
     </form>
     </body></html>

  5. #5
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default Uploading Photos.

    I haven't done exactly that and maybe somebody else has a better way but I'm sure it can be done.

    I set up a routine (in V5 in fact) that allows my clients to upload a backup file to my website without them having access to my password. It was originally done with a free external program but I believe it can now be done with the FTP_put_file() command in v6. (I kept the external program for my "upload backup" routine because it allows the user to continue using A5 while the external program continues the upload. The largest upload so far was a 32 Mb zip file and it would be a bit annoying to wait for that to upload.)

    Obviously, it's only a file so you could do the same thing to upload the photos.

    Then, I believe you could use an Image Reference field to store the photo. If this doesn't work for some reason, I would think any field could store the file name (in fact, that might be the preferred way on the web) and your page could decide which photo to display.

    Cal Locklin
    www.aimsdc.net

Similar Threads

  1. Format changes on uploading
    By Robert Rough in forum Web Application Server v6
    Replies: 8
    Last Post: 06-23-2005, 11:51 AM
  2. Uploading files
    By John Costello in forum Alpha Five Version 5
    Replies: 10
    Last Post: 06-21-2005, 05:45 AM
  3. uploading images on the fly
    By Stephen Barron in forum Alpha Five Version 6
    Replies: 1
    Last Post: 06-14-2005, 03:34 PM
  4. uploading to SQL 2000
    By james rittmann in forum Alpha Five Version 5
    Replies: 0
    Last Post: 10-20-2003, 07:22 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
  •