Alpha Video Training
Results 1 to 4 of 4

Thread: Getting the folder location on file upload and file download javascript

  1. #1
    Member
    Real Name
    Brad Steinfeldt
    Join Date
    Feb 2002
    Location
    Murray, Utah
    Posts
    137

    Default Getting the folder location on file upload and file download javascript

    Does anyone know if there's a way to get the folder location when using the file upload and file download action javascripts? I want to know from where the client is taking the file on upload, and where he is putting the file when he downloads.

    For example...
    When a client uploads a file, I want to embed an image that is in the same folder into a field of my table. The image file will always be in the same folder, and its name is always the same as the file the client uploads. The only difference is the file extension is ".metathumb", which is a jpg file format. Right now, the only way I can think to get that folder location is to make the user enter it on a separate field, and then find it that way.

    Likewise...
    When a client downloads a file, I want to create a matching image file with the ".metathumb" extension in the same folder.

    I'm new at making web/browser apps, but I'm trying to learn. I don't know javascript, but I'm fairly proficient at xbasic, so if I can get the info I need into my xbasic script, I can handle it.
    Brad Steinfeldt

  2. #2
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Getting the folder location on file upload and file download javascript

    If you go into your action and convert it to text mode you should see what's going on and in the file upload action for sure, it looks like you can get where the file is coming from. I'm not sure on the file download action though and for security reasons it may not be possible. In general, it's not secure to allow the download of an extra file the user didn't ask for. You may be able to zip the two files together server-side though so the user is actually downloading a zip. I'm not sure if that's something you'd want though. Another option would be to have the server automatically send your second file but it would be up to the user to say yes to the download. These actions use these two pages that you can look at in your webroot:

    __a5FileDownload.a5w
    __a5FileUploadMasterPage.a5w

    You can read through and see what's going on.

  3. #3
    Member
    Real Name
    Brad Steinfeldt
    Join Date
    Feb 2002
    Location
    Murray, Utah
    Posts
    137

    Default Re: Getting the folder location on file upload and file download javascript

    Thanks for the reply. I'll look into it.
    As for the download, what I'm doing is just on the LAN, so security isn't an issue (but I guess it would be if I ever tried to make it workable on the net).
    Brad Steinfeldt

  4. #4
    Member
    Real Name
    Brad Steinfeldt
    Join Date
    Feb 2002
    Location
    Murray, Utah
    Posts
    137

    Default Re: Getting the folder location on file upload and file download javascript

    It looks like the variable is found in this line,
    var fileUploadUrlQueryString = 'fileUploadUrl=' + urlencode({grid.object}.ajaxURL);
    but I don't understand the concept of javascript well enough to know what to do with it. I'm finally understanding the concept of "client-side" and "server-side", but how things work back and forth -- I'm not even in the "baby food" stage yet.
    Brad Steinfeldt

Similar Threads

  1. File upload pack: specifying the upload folder
    By marcPCA in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 06-16-2012, 08:49 AM
  2. drag & drop file/folder link location
    By gwitasod in forum Alpha Five Version 11 - Desktop Applications
    Replies: 1
    Last Post: 05-30-2012, 10:46 PM
  3. File Upload and File Download have vanished from my Grid ?
    By Zradene in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 05-19-2011, 04:05 AM
  4. File Upload - Specify folder?
    By eskimoavenue in forum Application Server Version 10 - Web/Browser Applications
    Replies: 7
    Last Post: 01-26-2011, 01:59 PM
  5. Multiple File Upload/Download
    By michaelwpayton in forum Application Server Version 9 - Web/Browser Applications
    Replies: 1
    Last Post: 11-01-2009, 10:40 PM

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
  •