Question:
HTML PHP question about uploading?
Sandeep N
2010-01-30 08:29:23 UTC
Scenario:
users uses a Wysiwyg editor for the input data. the image attached in the context but the Src (referencing) on the local computer ... need to parse input(bare HTML) fetch the local referencing upload it to server then change the src then to the Database....

i already did parsing thing .... but need script to upload image to server with php script no forms (enctype="multipart/form-data")

Thanks in Advance
Four answers:
2010-01-30 08:58:31 UTC
I'm really not exactly sure what you're trying to do here, but I'll give it a shot...



This situation is what AJAX was invented for. Your PHP program can't initiate the request (it doesn't have any way to know when the user is finished editing the data)



Use a JavaScript function to gather the data and then bundle it to the PHP program through an AJAX request.



Hope this helps...
Ralph S
2010-01-30 08:47:10 UTC
I've heard of server push, but not server pull.



Therefore, the client software must provide a content (not context) item variable that includes the image data to be uploaded all during the initial forms submission.



The forms either have to use a control that grabs the image data from the client's PC via drag-n-drop, etc, or forces the client user to use a file input control to browse / open the path to the image file, then submit it in a Post rather than a Put / Get forms submit processing.



The main deal would then be to check that the submitted content length is not greater than what is expected, and then to process each content item as it comes in from the form submission--be it parsing HTML or saving / storing image data into a temp folder to be moved elsewhere depending on the parse processing.



Some of this processing could be done by a Java control at the client side, but the data would still be sent from the client via a Post submission to the server.



On a private LAN with public file shares, it might be possible to do a server pull of the data from those local machines by using UNC file paths. However, the web server software must switch from using the "nobody" un-privilaged user to a user who is capable of accessing shares on the LAN, then grabbing the given file. This user switching is possible--so you'll have to find software that can do this for you.



There was a program for Unix / Linux named CGIwrap that switched users to the user account authorization of the remote user prior to executing any cgi scripts. In this way, it reduced any security risks involved with running a corporate user's cgi-bin scripts.



The cgiwrap would itself be the cgi-bin program used with a username path supplied for the intended switched username.



http://www.google.ca/search?q=cgiwrap



It is open source software and worked back in 1995 when I used it back then. If there is a port to Windows, the application should work similarly, permitting a user from a more privileged group to be used to access, for example, UNC shared files from other PCs on the LAN.



I just researched some more, and the Win32 API system call that has this ability to switch users on a per process basis is called CreateProcessAsUser( ). So whatever software is used on a Windows web server is likely to make use of this system call that would permit the use of a copy command to fetch data (server pull) of the image data file(s) from your client PCs.
drude
2016-12-04 12:46:10 UTC
Odds are, if the region has own homestead web page, it truly is a Linux website, not a homestead windows website, so it doesn't have a C: power. even with the actuality that if it did, C:temp might want to be /temp, and also you'll't get precise of entry to at least something above your own listing. keep the archives to ./temp and it truly is going to artwork in wither surroundings (it truly is the temp listing off your position listing).
2010-01-30 08:34:08 UTC
http://phpclasses.org will probably have what you want.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...