473,692 Members | 2,529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to get complete path while in file uploading

254 Contributor

I want to get the complete path of a file when we are uploading any image or file.
Apr 7 '09 #1
15 9637
1,654 Recognized Expert Top Contributor
what exactly did you mean?
Apr 10 '09 #2
254 Contributor
when we are uploading file it takes path and I want to get that complete path
Apr 13 '09 #3
194 New Member
when you are trying to upload a file then u have to define a path where u have to move the uploaded file. please go through move_uploaded_f ile at php.net. this will give u comprehensive details or try to look at google.
Apr 15 '09 #4
254 Contributor
Thanks! dude I will definetly look at php.net
Apr 15 '09 #5
194 New Member
mukesh try to use getcwd() function this will return the path of the current working directory.

Expand|Select|Wrap|Line Numbers
  2. echo getcwd();
Apr 15 '09 #6
254 Contributor

I don't want the path of current working directory. What i wanted is when we are uploading any image we browse that file from local machine say from c:\program files\mukesh.gi f. so this path comes in input type file's text box. I want to get this path and wanted to show that image for preview purpose to user so that he/she can know what kind of image they are going to upload before uplaoding image in any html element like div or span.

if u need further clarification feel free to ask but please help me out
Apr 16 '09 #7
8,658 Recognized Expert Moderator Expert
looks more like a job for JavaSript (kind of validation). once you submit the form, you have already uploaded the image. it would be a waste of time and bandwidth if the user decides to not take this image.
Apr 16 '09 #8
254 Contributor
before uploading image i want to show the preview of image
Apr 16 '09 #9
8,658 Recognized Expert Moderator Expert
you can use Javascript to get the path from the input field (field.value), create an <img> and pass this value to the src attribute.
Apr 16 '09 #10

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

Similar topics

by: Ralph Freshour | last post by:
I'm reading the php manual to find out how to get the path of a file I'm uploading from my PC - I'm using the $_FILES var but that is just the filename - is there a function that I can use to get it's full path too? or is it by the time php gets it it's on the server so it's too late to worry about it? do I have to get into javascript to get the path on the PC side??? I'm trying to check the filesize before having to upload the file to...
by: Don | last post by:
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 =---
by: Anders Eriksson | last post by:
Hello! I'm trying to create a program that will watch a directory and when a file is created print that file. I have used FileSystemWatcher for watching the directory and I get an created event. The problem is that I don't know when the file is complete when using Explorer copy or move. I have tried to use FileIOPermission but I always get that the file is
by: darrel | last post by:
I have an input type="file" field that I am using to accept a file upload. This works, but I'm having problems with the filename property. In firefox, this: MyInputField.postedfile.filename returns the filename...and just the filename. Which is what I want. In IE, however, this returns the ENTIRE local user's system path to the file
by: bostonnole | last post by:
I am getting this WinIOError "Insufficient system resources exist to complete the requested service" when I try to execute the following code in an ASP.NET 1.1 application uploading a very large file (140 MB). Server is Windows 2003 Standard (SP1) with 1 GB memory running IIS 6. There is plenty of free hard drive space. STACKTRACE: at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream.WriteCore(Byte...
by: Glenn Coyle | last post by:
Hi I am having trouble writing the file path of a image to the database,also for some reason it is not uploading the images, anyone have any ideas? the code is below: if($_POST == 'Submit') {
by: DMG | last post by:
I have <identity impersonate = "true" /& <authentication mode="Windows"/in the web.config. This is a 2.0 site. My Goal: I want to simply have the user browse to a file on a mapped drive and get the UNC for that file and eventually save that unc path to the database as a link. The problem is depending on office we have the same drive letter mapped to different servers. My current test works when I run everything locally and maps...
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the function creates the file as expected. When I loop through my array I get the error - "ArgumentException was unhandled - Illegal characters in path" The value "C:\Temp.txt" is the first value in the array - as it works
by: ish | last post by:
hello everybody...... plz help me out... how we can store the acual path of uploading file.i want to store the path of file in my database...bt i m not getting anyway to implement that......if i try to do it with the name="filename"......i mean if echo filename it only print or gives the filename only...it does nt give path along the name.... plzzzzz guys tell me a way to store the path....i need it for my project........waiting 4 ur...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.