Results 1 to 12 of 12

Thread: Upload Field - Edit

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Upload Field - Edit

    Ok last time I checked this wasnt possible but I'll try again,

    I have a form that takes some input of which 3 image upload fields exist. All works fine, when the user comes back to edit can I set the default value of the upload field to be the value they last uploaded? I understadn the security risk and why this wasnt possible but I'm interested to know if there is a work around.

    Pino

  2. #2
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602

    Re: Upload Field - Edit

    Are you using a database? If so why not create a field on the user table called "LastUploadValue" and store it there? This way you can load this value in based on the user.
    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Upload Field - Edit

    Psyrus,

    I'm sorry but did you reply to the right thread? Having a database has nothing to do with setting the Default Value of an upload field.

  4. #4
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602

    Re: Upload Field - Edit

    I meant using a database field to store the value as a string. When that person logs back on just load the value in from the database. I was thinking something like this:

    Code:
    <html>
    <head>
    <script>
    function storepath() {dbField = sFilePath.value;}
    function loadpath() {sFilePath.value = dbField;}
    </script>
    </head>
    <body onload = "loadpath();" onloadonunload = "storepath();">
    <input type="file" ID = "sFilePath">
    </body>
    </html>
    I think the storing part will work (with modifications depending on what server side scripting you are using) but the loading part won't. This was just a thought. Sorry.
    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Upload Field - Edit

    Have you tested that script? Setting the value of a Upload field doesnt seem to work. (And rightly so!! It would open up a host of security issues)

    Pino

  6. #6
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602

    Re: Upload Field - Edit

    Yeah, I tried it. I posted that code as an example of what I was thinking. You can capture the value but not load it.
    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

  7. #7
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Upload Field - Edit

    Quote Originally Posted by Psyrus View Post
    Yeah, I tried it. I posted that code as an example of what I was thinking. You can capture the value but not load it.
    Where is the database located? On the server or on the local machine? Maybe you could save the last input info to the users computer rather than the server?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Upload Field - Edit

    Exactly and my question is what are the workaround for loading a value?

  9. #9
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Upload Field - Edit

    Quote Originally Posted by Pino View Post
    Exactly and my question is what are the workaround for loading a value?
    Why not save the info as a cookie instead of in a database?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Upload Field - Edit

    ok seriously saving the data is not a problem... Cookie,Session,DB Not an issue.

    my question is what are the workarounds for loading a value into a Upload Field, to show the user that they allready have a file uplaoded?
    Last edited by Pino; Apr 28th, 2009 at 07:20 AM.

  11. #11
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: Upload Field - Edit

    Quote Originally Posted by Pino View Post
    ok seriously saving the data is not a problem... Cookie,Session,DB Not an issue.

    my question is what are the workarounds for loading a value into a Upload Field, to show the user that they allready have a file uplaoded?
    AFAIK, its not possible. When the user comes back to edit, you would hide the upload field and print some text (filename?) where the upload field was previously to show what file exists on the server. You might then include a separate upload field for uploading a new file to replace the old one.

    Someone else might be able to correct me on this if I'm wrong.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  12. #12

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Upload Field - Edit

    As I suspected really, Thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width