PHP upload without using a form

11-13-07, 08:33 AM
|
 |
Community VIP
|
|
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Acecool, the form type="file" value field is read only. It cannot be set (many people have tried.) If you have or find working code that can do this, please post it.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
|

11-13-07, 11:03 PM
|
 |
Aspiring Coder
|
|
Join Date: Nov 2003
Posts: 506
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Im saying, since he knows where the files are located on his computer, he should make a form and fill in the values... then when the page is loaded have javascript simulate pressing the submit button..
Josh
|

11-13-07, 11:21 PM
|
 |
Community VIP
|
|
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
If you read what I wrote (or try it yourself), you cannot set the value. You cannot use a value="..." parameter in the HTML nor can you write the value using javascript.
Again, if you have or find working code that can accomplish what you think, please post it.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
|

11-14-07, 12:19 AM
|
 |
Community VIP
|
|
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
zaher, synchronizing files is best done server to server. If you can setup the source where the files are at as a server, you can use php running on the source server to write the files to the destination using the FTP protocol, or you can use php running on the destination server to read them from the source server using the FTP protocol, or you can use php running on the destination server to read them from the source server using the http/https protocol.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
|

11-14-07, 05:58 AM
|
|
Newbie Coder
|
|
Join Date: Nov 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you guys.
Anyway, I have switched to Java for this project, and created a java applet and application to do so, and it worked out well.
I just got one issue with that java application which i have described in this thread.
|

04-04-11, 11:29 AM
|
|
New Member
|
|
Join Date: Apr 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Multiple Uploads with PHP without using a form
So you want to upload multiple files without a form using PHP? I do not know the specifics of what you are trying to do, but I had an idea. What if you use a single form where you upload an archive that is organized to put the multiple files where they belong on the server? You could upload the single archive file, and then use copy() or rename() to copy or move the files to the appropriate locations on the server after the archive has been extracted. Would that work in your case?
Last edited by ItsMee; 04-04-11 at 11:30 AM.
Reason: added " after the archive has been extracted"
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|