473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to get the fullpath of hte file

hi
i want the fullpath of the file to be upload.
(e.g) we are using FILE to upload files.
in that we can get only the file name(sample.txt) using $_FILE['userfile']['name'];
but i want the real path of the file also (e.g C:\Program Files\Sample.txt")
Jun 22 '07 #1
4 4487
r035198x
13,262 8TB
hi
i want the fullpath of the file to be upload.
(e.g) we are using FILE to upload files.
in that we can get only the file name(sample.txt) using $_FILE['userfile']['name'];
but i want the real path of the file also (e.g C:\Program Files\Sample.txt")
Do not post questions in the articles section.
Moved to the forum.
Jun 22 '07 #2
bonski
53
hi
i want the fullpath of the file to be upload.
(e.g) we are using FILE to upload files.
in that we can get only the file name(sample.txt) using $_FILE['userfile']['name'];
but i want the real path of the file also (e.g C:\Program Files\Sample.txt")
hi musammil,

you can use [PHP]$_POST['form_field'][/PHP]

this is getting the filename...
[PHP]$_FILE['userfile']['name'][/PHP]

and this is getting the whole path...
[PHP]stripslashes($_POST['userfile'])[/PHP]
i used stripslashes() to strip extra slashes from the string...

bonski
Jun 22 '07 #3
ronnil
134 Expert 100+
I think it is browser-dependent if it posts only the filename or the complete path.
Jun 22 '07 #4
pbmods
5,821 Expert 4TB
You can create a hidden input in your form that stores the value of your file input. When the User submits the form, the file path will be passed to the server as well.

[EDIT: Ooh. Getting the $_POST value of the file input. Neat! I'll have to remember that!]
Jun 22 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
5
by: copyco | last post by:
Is there a way to locate a node on the Treeview by a node's fullpath property? Thanks.
3
by: DBC User | last post by:
Just curious from performance and size perspective, if in a code I use a class (like Path), I need to include corresponding using to use it in the code (in this case System.IO). My question is ...
3
by: irfan.mohammed | last post by:
Dear All, I am working on php with html form input type file.i want to get the fullpath of my file which i have selected from my computer. example :C:\programs\..... can anyone help me, ...
7
by: sudhaMurugesan | last post by:
Hi all, I use asp.net with c#. I upload a file and save in a directory. I want to reopen the file so i check for file exists and then open it. But though the file exists, the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.