How do I retrieve the full path (C:\.....filename) of a file uploaded to a php script on the server.
I think $_FILES will only provide 'name', which is only the filename itself.
Thanks, Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =--- 9 5326
Don wrote: How do I retrieve the full path (C:\.....filename) of a file uploaded to a php script on the server.
That information usually isn't sent. And see RFC2183 sec.
2.3 (http://www.ietf.org/rfc/rfc2183.txt ).
I think $_FILES will only provide 'name', which is only the filename itself.
But $_FILES['foo']['name'] will be empty if no filename is
given to the server. Although they 'should attempt to
supply a file name for each submitted file' (HTML4.01 sec.
17.3.4), user agents are not required to supply them.
HAGW!
--
Jock
John Dunlop <us*********@john.dunlop.name> wrote in
news:MP************************@News.Individual.NE T: Don wrote:
How do I retrieve the full path (C:\.....filename) of a file uploaded to a php script on the server.
That information usually isn't sent. And see RFC2183 sec. 2.3 (http://www.ietf.org/rfc/rfc2183.txt ).
I think $_FILES will only provide 'name', which is only the filename itself.
But $_FILES['foo']['name'] will be empty if no filename is given to the server. Although they 'should attempt to supply a file name for each submitted file' (HTML4.01 sec. 17.3.4), user agents are not required to supply them.
HAGW!
I wonder if javascript could get it from the fileupload box, attach it to
a hidden form, which is available on the next page as a post. Never tried
it tho.
On Sat, 23 Oct 2004 17:29:44 -0000, Theo <in*****@noemail.com> wrote: John Dunlop <us*********@john.dunlop.name> wrote in news:MP************************@News.Individual.N ET:
Don wrote:
How do I retrieve the full path (C:\.....filename) of a file uploaded to a php script on the server.
That information usually isn't sent. And see RFC2183 sec. 2.3 (http://www.ietf.org/rfc/rfc2183.txt ).
I think $_FILES will only provide 'name', which is only the filename itself.
But $_FILES['foo']['name'] will be empty if no filename is given to the server. Although they 'should attempt to supply a file name for each submitted file' (HTML4.01 sec. 17.3.4), user agents are not required to supply them.
HAGW!
I wonder if javascript could get it from the fileupload box, attach it to a hidden form, which is available on the next page as a post. Never tried it tho.
I'm not sure how to construct the javascript to do what you recommend. Can you show me an example?
Thanks, Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Don <no@adr.com> wrote in
news:q6********************************@4ax.com: On Sat, 23 Oct 2004 17:29:44 -0000, Theo <in*****@noemail.com> wrote:
John Dunlop <us*********@john.dunlop.name> wrote in news:MP************************@News.Individual. NET:
Don wrote:
How do I retrieve the full path (C:\.....filename) of a file uploaded to a php script on the server.
That information usually isn't sent. And see RFC2183 sec. 2.3 (http://www.ietf.org/rfc/rfc2183.txt ).
I think $_FILES will only provide 'name', which is only the filename itself.
But $_FILES['foo']['name'] will be empty if no filename is given to the server. Although they 'should attempt to supply a file name for each submitted file' (HTML4.01 sec. 17.3.4), user agents are not required to supply them.
HAGW!
I wonder if javascript could get it from the fileupload box, attach it to a hidden form, which is available on the next page as a post. Never tried it tho. I'm not sure how to construct the javascript to do what you recommend. Can you show me an example? Thanks, Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
try this...
assuming you have the standard fileupload box in a form, call it myimage,
and the form is myform, add an onfocus function call to the upload box to
call a function named as you choose.
In the box put
onFocus="passfilename();"
In the function put:
filename = document.myform.myimage.value;
'filename' will be whatever is in the box. then attach that value to the
hidden field with
document.myform.hiddenfield.value = filename;
and submit the form.
use POST to get the value as you would any other. dont know whether it
will balk at the slashes and colon.
On Sun, 24 Oct 2004 00:33:53 -0000, Theo <in*****@noemail.com> wrote: Don <no@adr.com> wrote in news:q6********************************@4ax.com :
On Sat, 23 Oct 2004 17:29:44 -0000, Theo <in*****@noemail.com> wrote:
John Dunlop <us*********@john.dunlop.name> wrote in news:MP************************@News.Individual .NET:
Don wrote:
> How do I retrieve the full path (C:\.....filename) of a file > uploaded to a php script on the server.
That information usually isn't sent. And see RFC2183 sec. 2.3 (http://www.ietf.org/rfc/rfc2183.txt ).
> I think $_FILES will only provide 'name', which is only the > filename itself.
But $_FILES['foo']['name'] will be empty if no filename is given to the server. Although they 'should attempt to supply a file name for each submitted file' (HTML4.01 sec. 17.3.4), user agents are not required to supply them.
HAGW!
I wonder if javascript could get it from the fileupload box, attach it to a hidden form, which is available on the next page as a post. Never tried it tho. I'm not sure how to construct the javascript to do what you recommend. Can you show me an example? Thanks, Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
try this...
assuming you have the standard fileupload box in a form, call it myimage, and the form is myform, add an onfocus function call to the upload box to call a function named as you choose.
In the box put onFocus="passfilename();"
In the function put: filename = document.myform.myimage.value;
'filename' will be whatever is in the box. then attach that value to the hidden field with
document.myform.hiddenfield.value = filename;
and submit the form.
use POST to get the value as you would any other. dont know whether it will balk at the slashes and colon.
Theo,
IT WORKS!! I did exactly as you recommended, and it works just great. You don't know how relieved
I am that this is working. Thank you so much. I don't know what I'd do without these news groups.
What a tremendous asset. When I'm good enough, I expect to do my share of helping others.
Thanks again,
Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
On Sat, 23 Oct 2004 19:45:44 -0700, in comp.lang.php Don <no@adr.com>
wrote: | On Sun, 24 Oct 2004 00:33:53 -0000, Theo <in*****@noemail.com> wrote:
[snip]
| >try this... | > | >assuming you have the standard fileupload box in a form, call it myimage, | >and the form is myform, add an onfocus function call to the upload box to | >call a function named as you choose. | > | >In the box put | >onFocus="passfilename();" | > | >In the function put: | >filename = document.myform.myimage.value; | > | >'filename' will be whatever is in the box. then attach that value to the | >hidden field with | > | >document.myform.hiddenfield.value = filename; | > | >and submit the form. | > | >use POST to get the value as you would any other. dont know whether it | >will balk at the slashes and colon. | | | Theo, | | IT WORKS!! I did exactly as you recommended, and it works just great. You don't know how relieved | I am that this is working. Thank you so much. I don't know what I'd do without these news groups. | What a tremendous asset. When I'm good enough, I expect to do my share of helping others.
Don, just out of curiosity, why do you want the information on where
the users is uploading the file from?
--------------------------------------------------------------- jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
On Sun, 24 Oct 2004 08:46:02 GMT, Jeff North <jn****@yourpantsbigpond.net.au> wrote: On Sat, 23 Oct 2004 19:45:44 -0700, in comp.lang.php Don <no@adr.com> wrote:
| On Sun, 24 Oct 2004 00:33:53 -0000, Theo <in*****@noemail.com> wrote:
[snip]
| >try this... | > | >assuming you have the standard fileupload box in a form, call it myimage, | >and the form is myform, add an onfocus function call to the upload box to | >call a function named as you choose. | > | >In the box put | >onFocus="passfilename();" | > | >In the function put: | >filename = document.myform.myimage.value; | > | >'filename' will be whatever is in the box. then attach that value to the | >hidden field with | > | >document.myform.hiddenfield.value = filename; | > | >and submit the form. | > | >use POST to get the value as you would any other. dont know whether it | >will balk at the slashes and colon. | | | Theo, | | IT WORKS!! I did exactly as you recommended, and it works just great. You don't know how relieved | I am that this is working. Thank you so much. I don't know what I'd do without these news groups. | What a tremendous asset. When I'm good enough, I expect to do my share of helping others.
Don, just out of curiosity, why do you want the information on where the users is uploading the file from? --------------------------------------------------------------- jn****@yourpantsbigpond.net.au : Remove your pants to reply ---------------------------------------------------------------
Jeff,
It's complicated. I'm providing an improved version of a chat group page which has very limited
capability for attaching pictures. I'm reading in the original page, modifying it to include adding
browse boxes for uploading pictures. The user clicks on a "Preview" button, afterwhich a
server-side php script uploads the files, then provides back to the client page a preview of the
results of his pending post. That preview includes the same form data that he entered on the
original page, including the file browse boxes. This allows him the opportunity to make any
changes, afterwhich he clicks on "Previw" again, or "Post", which sends the info to the original
chat group for posting.. Everything seems to work okay, but now just discovered even though I have
the full path to his original file, I can't populate the original browse box for a <input
type=file...>. DARN! Guess the browser is designed that way for security reasons. So, guess I'll
have to come up with another approach. This has been a real learning curve for me, but I'm having
fun. Things are coming together pretty well. Just wish I could come up with an answer on this one.
If you have any ideas I'd appreciate your feedback.
Thanks for your inquiry.
Regards, Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
On Sun, 24 Oct 2004 05:00:00 -0700, in comp.lang.php Don <no@adr.com>
wrote: | On Sun, 24 Oct 2004 08:46:02 GMT, Jeff North <jn****@yourpantsbigpond.net.au> wrote: | | >On Sat, 23 Oct 2004 19:45:44 -0700, in comp.lang.php Don <no@adr.com> | >wrote:
[snip]
| >Don, just out of curiosity, why do you want the information on where | >the users is uploading the file from? | >--------------------------------------------------------------- | >jn****@yourpantsbigpond.net.au : Remove your pants to reply | >--------------------------------------------------------------- | | Jeff, | | It's complicated. I'm providing an improved version of a chat group page which has very limited | capability for attaching pictures. I'm reading in the original page, modifying it to include adding | browse boxes for uploading pictures. The user clicks on a "Preview" button, afterwhich a | server-side php script uploads the files, then provides back to the client page a preview of the | results of his pending post. That preview includes the same form data that he entered on the | original page, including the file browse boxes. This allows him the opportunity to make any | changes, afterwhich he clicks on "Previw" again, or "Post", which sends the info to the original | chat group for posting.. Everything seems to work okay, but now just discovered even though I have | the full path to his original file, I can't populate the original browse box for a <input | type=file...>. DARN! Guess the browser is designed that way for security reasons. So, guess I'll | have to come up with another approach. This has been a real learning curve for me, but I'm having | fun. Things are coming together pretty well. Just wish I could come up with an answer on this one. | If you have any ideas I'd appreciate your feedback. | | Thanks for your inquiry.
I don't know if this is going to help or hinder your progress.
If you look at the discussion forum on http://www.interactivetools.com/foru....cgi?forum=18; then do a
search on image, image preview etc. The basic app (htmlArea) simply
has a dialog box where you type in the url of the image. Other people
have wanted image preview (amongst other things). It might give you an
idea of what is involved. You might even find some code there that you
can use.
Also, if you still have the full path and filename in the input box
you might want to prepend file:/// to the name.
--------------------------------------------------------------- jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
On Sun, 24 Oct 2004 15:34:27 GMT, Jeff North <jn****@yourpantsbigpond.net.au> wrote: On Sun, 24 Oct 2004 05:00:00 -0700, in comp.lang.php Don <no@adr.com> wrote:
| On Sun, 24 Oct 2004 08:46:02 GMT, Jeff North <jn****@yourpantsbigpond.net.au> wrote: | | >On Sat, 23 Oct 2004 19:45:44 -0700, in comp.lang.php Don <no@adr.com> | >wrote:
[snip]
| >Don, just out of curiosity, why do you want the information on where | >the users is uploading the file from? | >--------------------------------------------------------------- | >jn****@yourpantsbigpond.net.au : Remove your pants to reply | >--------------------------------------------------------------- | | Jeff, | | It's complicated. I'm providing an improved version of a chat group page which has very limited | capability for attaching pictures. I'm reading in the original page, modifying it to include adding | browse boxes for uploading pictures. The user clicks on a "Preview" button, afterwhich a | server-side php script uploads the files, then provides back to the client page a preview of the | results of his pending post. That preview includes the same form data that he entered on the | original page, including the file browse boxes. This allows him the opportunity to make any | changes, afterwhich he clicks on "Previw" again, or "Post", which sends the info to the original | chat group for posting.. Everything seems to work okay, but now just discovered even though I have | the full path to his original file, I can't populate the original browse box for a <input | type=file...>. DARN! Guess the browser is designed that way for security reasons. So, guess I'll | have to come up with another approach. This has been a real learning curve for me, but I'm having | fun. Things are coming together pretty well. Just wish I could come up with an answer on this one. | If you have any ideas I'd appreciate your feedback. | | Thanks for your inquiry.
I don't know if this is going to help or hinder your progress. If you look at the discussion forum on http://www.interactivetools.com/foru....cgi?forum=18; then do a search on image, image preview etc. The basic app (htmlArea) simply has a dialog box where you type in the url of the image. Other people have wanted image preview (amongst other things). It might give you an idea of what is involved. You might even find some code there that you can use.
Also, if you still have the full path and filename in the input box you might want to prepend file:/// to the name. --------------------------------------------------------------- jn****@yourpantsbigpond.net.au : Remove your pants to reply ---------------------------------------------------------------
Thanks Jeff. I checked out that forum. It looks like it should be of great help.
Regards,
Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =--- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Willoughby Bridge |
last post by:
I am having trouble with a file upload script. Have tried a lot of
different methods and the problem boils down to the $_FILES variable not
being picked up. Below is a simple example of...
|
by: SU_Oran |
last post by:
I found this when searching. I need to have a simple script that will
upload a single file.
It is giving me an error on Set upl =
Server.CreateObject("ASPSimpleUpload.Upload")
It is saying :
...
|
by: Chuck |
last post by:
Hi, can anyone provide or point me in the direction of a simple python
file upload script? I've got the HTML form part going but simply
putting the file in a directory on the server is what I'm...
|
by: gmax2006 |
last post by:
Hi,
I use RedHat linux.
How can I find where exactly the current python script is running?
I use this code:
#test.py
import os,sys
|
by: pbd22 |
last post by:
hi.
i am having probs understanding how to grab a file being uploaded from
a remote client. i am using hidden input fields for upload such as:
<input id="my_file_element" type="file"...
|
by: fatjoez |
last post by:
Hey there.
I've been trying to modify my file upload script so that it handles 10 files instead of one.
i was thinking the most straightforward way would be to add a FOR LOOP? placed...
|
by: wasif |
last post by:
I am trying to upload file using ajax and php but having some problems. it always says that there was a problem and file is not uploaded. here is the code
form and ajax code
<!DOCTYPE html...
|
by: kksandeep |
last post by:
i am using this three files to uplod file. i got this file from net but i think these have some error. i am new to this field plz help
the script i found is some helpful but not too that i need
...
|
by: owz2008 |
last post by:
This has probably been covered before but could not find a similar thread.
Basically I have created a form which can be viewed at www.icomworks.co.uk/canvaspayform.html
I want to submit the...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |