473,856 Members | 1,682 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

uploading defined file

xxoulmate
77 New Member
how can i upload a file on server.

<?php
$filename = "c:\file.tx t";

?>

i want to upload the $filename on the server is there a way for it.,
Oct 8 '09 #1
6 1483
Dormilich
8,658 Recognized Expert Moderator Expert
in most cases you use a form to upload the data from the client computer. (see also this article).

if you want to trigger that from the server side, you probably need to use cURL (no success guaranteed).
Oct 8 '09 #2
xxoulmate
77 New Member
how about not using the input file.,

is there a functions in php that can upload just set the file path to be upload.
e.g. c:\upload.txt
Oct 9 '09 #3
TheServant
1,168 Recognized Expert Top Contributor
@xxoulmate
Not PHP. I am 99.9% sure you can't do that with any web language. The reason is that the web needs to go through your browser, if the clients browser let you access files like that, the security risk would be so massive, I would not be on the internet. Having said that, *maybe* something can be done with vb.net or asp, but if you did find that this was possible, the potential for stealing files would risk you being held accountable... For uploads, you are better off just trying a traditional upload input.

Anyway, not all computers will be set up the same with the same file path.
Oct 9 '09 #4
xxoulmate
77 New Member
how about., instead of input file to use,
input text will be use as the file to be uploaded.
Oct 9 '09 #5
Dormilich
8,658 Recognized Expert Moderator Expert
that is, so to speak, the classical way of form processing (only that you save the text to file in the end).
Oct 9 '09 #6
TheServant
1,168 Recognized Expert Top Contributor
@xxoulmate
That is fine, but possibly a little overkill from totally automated to totally user submitted. Can you elaborate on what you're trying to do and maybe we can give you better suggestions?

If not then a simple textarea which gets processed to become a file (look up "php create file" if you're unsure) will do the trick. Just remember you really should be inspecting and sanitizing the user submitted data.

Rule #1 of PHP programming (and most user interacting languages) is trust no one!

What is in your text file you're looking for? Better than a big textarea for users to put what they want, would be a series of inputs where you can check that the data matches what it should. Checking one large text block is more involed/risky than a few smaller ones.
Oct 9 '09 #7

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

Similar topics

5
7845
by: Kevin Ollivier | last post by:
Hi all, I've come across a problem that has me stumped, and I thought I'd send a message to the gurus to see if this makes sense to anyone else. =) Basically, I'm trying to upload a series of files via FTP. I'm using ftplib to do it, and for each file I'm using transfercmd("STOR " + myfile) to get the socket, then uploading 4096 bytes at a time and providing status updates via a GUI interface. Finally, I close the socket, set it to...
13
4333
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 that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
1
451
by: Sheldon Glickler | last post by:
I am having a problem uploading on one system and not on another with very similar code in two different applications. I suspect that it has to do with server settings. Here is the code that works. It is on a deicated server in a private company with the latest PHP installed. APPLICATION #1 --------------------- if (isset($_POST)) {
5
2737
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or more documents to share/use during a meeting presentation. What would be the most efficient way to approach this? This is the logic I'm currently considering: Page 1: Meeting Information input with link to a document upload page (this page...
1
2005
by: sean | last post by:
Hi, I am a complete novice but would liket to have a PHP script which will upload a file which is pre-defined, without the need for the user to 'Browse' for a file path. For example, the pre-defined file would be "C:\temp\test.txt", and the script will already know this value without the user telling it. I tried filling the textbox with a file path value, but it doesn't work with the input type "file", only as a "textbox". So I am now
0
10694
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 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...
1
10774
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10379
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 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...
0
9528
agi2029
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...
1
7929
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5757
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...
0
5956
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3196
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.