home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2734
Discussions: 186,608, Posts: 2,227,066, Members: 230,243
Free Scan: Update Your PC's Outdated Drivers to Optimize Performance
Old September 2nd, 2008, 02:21 AM   Digg it!   #1 (permalink)
Senior Member
 
Join Date: May 2003
Location: Aus, Gold Coast :)
Posts: 793
Send a message via ICQ to exally
PHP File uploading

Ok guys, got a problem and would be very surprised if anyone knew of a simple solution. I have 100% dynamic forms (created by any number of people) in PHP/HTML. So you can go into the admin section and create your own form, basically the simple type, checkbox, radio, text, textarea, select and FILE. now here is the problem, using the same file input field they need to be able to conitually upload files with out refreshing the page. (deleting and all that i have covered with AJAX). Unfortunately from what I have read you can't Post files using Ajax and all the examples of using IFRAMES i need to have an embedded form (to allow the input to save) and of course this is a big no-no. Any other ideas?!

Thanks in advance.

exally is offline   Reply With Quote
TechIMO.com Ads - Login or register for less ads.
How many errors does your computer have?

You no longer need to guess! This free stability scan and registry cleaner download will give you a complete diagnosis of your Windows registry, identifying errors and conflicts.

FREE instant scan


Guest, Register Free! to remove this ad and get your tech support questions answered in minutes!
Old September 5th, 2008, 03:16 AM     #2 (permalink)
Senior Member
 
Join Date: May 2003
Location: Aus, Gold Coast :)
Posts: 793
Send a message via ICQ to exally
i have done this but now am getting a problem...

I have a button for each file after it is uploaded to delete the file if they want. However in Safari and Firefox when click the 'Browse' button associated with the file input, it calls the first 'Delete' button aswell... very frastrating.

Easternwell Group - no information is recorded and there is only one input field if u want to have a look at it.

exally is offline   Reply With Quote
Old September 6th, 2008, 12:34 PM     #3 (permalink)
Member
 
Join Date: Jul 2008
Posts: 30
Blog Entries: 1
Send a message via AIM to theGlitch
Sounds like a bug in your code... make sure all of the buttons are coded properly

theGlitch is online now   Reply With Quote
Old September 7th, 2008, 08:17 PM     #4 (permalink)
Senior Member
 
Join Date: May 2003
Location: Aus, Gold Coast :)
Posts: 793
Send a message via ICQ to exally
i have been looking at them for a while now and they look alright to me

Code:
<div id="i<?= $it;?>a">
            <?
	if($files != "-1")
	{
	               $files = explode(",", $files);
	               for($i=0; $i<count($files); $i++)
		{
              ?>
                                      <a href="..<?=$files[$i];?>" target="_blank"><?=$files[$i];?></a>
                                      <input class="field2" type="button"  name="fail" id="fail" onclick="sendRequest2('i<?=$it;?>','<?=$files[$i];?>')" value="X"/>
                        <br/>
               <?
		}
	}
	?>
            <input type="hidden" name="buffer" value="whatever"/>
            <input class="field" type="file" name="i<?= $it;?>" id="i<?= $it;?>" onChange="jsUpload('i<?=$it;?>')"/>
            </div>
i tried the hidden buffer to see if it would stop/protect the button, $files is a list of files basically saved in the database, they are comma separated, hence the explode... if there is nothing in there -1 is the value

Last edited by exally : September 7th, 2008 at 08:20 PM.
exally is offline   Reply With Quote
Old September 7th, 2008, 08:57 PM     #5 (permalink)
Senior Member
 
Join Date: May 2003
Location: Aus, Gold Coast :)
Posts: 793
Send a message via ICQ to exally
i have fixed the problem by putting the uploaded files after the file input... this is a wierd problem that stems from Safari and Firefox 3 having default buttons.
exally is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best free PHP uploading script? gunstar General Tech Discussion 0 April 18th, 2006 05:37 PM
vb.net code for uploading file applemynt General Tech Discussion 1 April 1st, 2006 09:04 AM
PhP:Avatar Uploading NeoStarO1 Webmastering and Programming 0 August 9th, 2003 04:42 PM
Help uploading jpeg file! TraceyD Webmastering and Programming 14 April 25th, 2003 07:12 PM
uploading file problem Naz Webmastering and Programming 2 September 3rd, 2002 01:39 PM

Most Active Discussions
Is It Just Me? (533)
Misery Loves Company... (1849)
Why Does the MOON Grow Bigger as It.. (18)
heatsink issue (10)
New Mobo (18)
UPGRADING C/D DRIVE TO 250GB & .. (14)
1 internet. 1 house. 3 computer. ho.. (13)
Is This A Compatible Gaming PC? (18)
SSD's, RAID, and External Backup (7)
Recent Discussions
help! jumbled text and computer.. (0)
DFI socket 939 board acting up (5)
Building my first PC and need s.. (2)
32 or 64 bit vista (4)
Big problem with my PC (2)
system restore 'next' button wo.. (2)
firewall (1)
C++ compiler suggestions (4)
Official World of Warcraft Thre.. (4529)
FS: Dell 6000 laptop, modded 36.. (2)
Apple iPod touch 16 GB $200 (4)
Six 28-Disc Cross Design Black .. (4)


All times are GMT -4. The time now is 12:35 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28