ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Insert a file path via Browse box without a file upload?

August 19, 2008 1:20pm

Subscribe [2]
  • #1 / Aug 19, 2008 1:20pm

    Sasha

    85 posts

    Okay - here’s what I’m trying to do:

    I’m using EE to build an Intranet for a local company. The website will be hosted online (not on a localhost), so employees can login from anywhere. Everything will only be available to logged-in members who are all verified employees.

    One section of the intranet will be a contacts database of sorts. Every weblog entry will have standard information associated with it (name, address, etc), but additionally, I need to associate each with a Word document on the networked file server of the company.

    Ideally, I’d like for the user to see a file upload field, where they can choose the right Word document via the Browse box. But when they submit the form, instead of uploading the file, I just want to save the full path to the file (like, H:\\Documents\2008\file.doc), and then in my templates, I’ll insert that path in a regular HTML link, so the file opens when they click it.

    The reasons the client doesn’t want it uploaded:

    1) the documents change on a regular basis. Pointing to it directly on the file server means anyone can open it and make changes to it, hit Save, and that’s it. No continuous re-uploading required.
    2) there’s a good couple hundred of these documents, if not more. It seems a bit superfluous to pay for the extra disk space and bandwidth to a web host if we can avoid it, as there’s no need for these files to live online.
    3) security wise, the company would prefer for these files to stay on their file server only, instead of online. Employees working from home won’t ever have to access them, so again, there’s no real need to have them online.

    I have tried creating a regular Text custom field, and in a SAEF, turned it into a type=“file” field. That did give me the Browse box, but the field just gets submitted as empty. I couldn’t find any extensions that give the option of just saving the path to the file instead of actually uploading it.

    Is this at all possible to do? Thanks in advance for any help!

  • #2 / Aug 27, 2008 10:49am

    Sasha

    85 posts

    Bump. Anyone have any ideas? 😊

  • #3 / Sep 01, 2008 8:34am

    Sasha

    85 posts

    Second bump! Anyone?

    I *know* PHP captures the local path to the file in order to upload it - surely there must be a way to save that to the database, instead of uploading and then discarding it? Or is this really impossible to do?

  • #4 / Sep 01, 2008 9:13am

    I would try, like you said, a text field and SAEF. I would just save it as text. I’m pretty sure there are some ready made scripts to create a browse button on an HTML form. I know that you can get them to put the file name in the text input box and not upload the file because I did that by mistake once! I’ll have a look if I get a chance and see it I can find a good script.

    Emily

  • #5 / Sep 01, 2008 9:15am

    Sasha

    85 posts

    Thanks Emily! I did try that - created a Browse box on the SAEF, but whenever I picked a file in there, it just submitted the field as empty (I had it as a general text field in the backend)!

  • #6 / Sep 01, 2008 9:23am

    Ok sorry that was my best suggestion!

    Did you ever manage to find out why it wasn’t submitting that path?

    I think how you had it is the right track.

    Emily

  • #7 / Sep 01, 2008 9:25am

    Sasha

    85 posts

    No - I haven’t figured out why it’s submitting blanks, that’s why I was posting here lol!! It’s like the path gets stripped out or something…I’m not sure. I was hoping someone here would be able to tell me! 😉

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases