Skip to main content
Inspiring
January 22, 2007
Answered

Insert/Update File Path difficulty

  • January 22, 2007
  • 4 replies
  • 328 views
I am trying to Insert into a VARCHAR field a file path as text that I can then transform into a hyperlink. This is held on an intranet site and I need the complete physical path within the network (not just on the server). I do NOT want to upload the file to a server folder.

ie: \\Mainserver\intranet\Referencefiles\Quote.xls
or
\\SomeoneelsesPC\temp\test.doc

I have put in a file input section
<input name="FILEREF" type="file" id="FILEREF" size="70">

and set the input behaviour to include the value as text.
GetSQLValueString($HTTP_POST_VARS['FILEREF'], "text"));

When I go to update or insert, it does not appear to be entering any value. This is part of a bigger insert/update statement and everything alse seems to work fine but this part doesn't.

What am I doing wrong?
This topic has been closed for replies.
Correct answer Newsgroup_User
RichardODreamweaver wrote:
> What I was hoping for was a "browse" button (similar to an upload format) but
> that only stores the path in the field.
>
> Is this possible to acheive without the upload function?

You can't do it with a browse button, but you can create a function to
query the file system and display a drop-down menu of available files. I
show how it's done in both "Foundation PHP for Dreamweaver 8" and "PHP
Solutions". If you want to roll your own, look up Filesystem functions
in the PHP online manual.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

4 replies

Inspiring
January 22, 2007
Thanks David
Newsgroup_UserCorrect answer
Inspiring
January 22, 2007
RichardODreamweaver wrote:
> What I was hoping for was a "browse" button (similar to an upload format) but
> that only stores the path in the field.
>
> Is this possible to acheive without the upload function?

You can't do it with a browse button, but you can create a function to
query the file system and display a drop-down menu of available files. I
show how it's done in both "Foundation PHP for Dreamweaver 8" and "PHP
Solutions". If you want to roll your own, look up Filesystem functions
in the PHP online manual.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Inspiring
January 22, 2007
Thanks for this David

to be honest, I have been able to store the file path correctly but this requires each user to correctly understand the path and type it in (or copy from windows explorer address bar).

What I was hoping for was a "browse" button (similar to an upload format) - placing just the path as text in the field.

Is this possible to acheive without the upload function?
Inspiring
January 22, 2007
RichardODreamweaver wrote:
> I have put in a file input section
> <input name="FILEREF" type="file" id="FILEREF" size="70">

Using type="file" uploads the file itself, not just the name of the
file. The name of the file will be in $_FILES['FILEREF']['name'], but
unless you actually want to upload the file, doing it this was is a
waste of time and resources.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/