Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 23-02-04
Dark Prince
 
Join Date: Aug 2003
Location: Moving to Windsor Woohoo!
Posts: 1,570
Thanks: 0
Thanked 9 Times in 7 Posts
lowndsy is an unknown quantity at this point
  Upload a file and save the name in a db

That's all I need to do - I can upload the image really easily, or add the name to a db, but not both at the same time and it's driving me bonkers!

I really need to validate it as well for certain file types and add other info into the db along with it but that's another job for another day at the moment.

Anyone got any suggestions?
Cheers,
Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 23-02-04
Dark Prince
 
Join Date: Aug 2003
Location: Moving to Windsor Woohoo!
Posts: 1,570
Thanks: 0
Thanked 9 Times in 7 Posts
lowndsy is an unknown quantity at this point
Thought someone might find this useful - a multiple file upload script that could be configured with variables passed from a form, but there is absolutely no security or even validation so use with caution.
Still no closer to what I need though


PHP Code:
<html>
<head>
</head>
<body>
<center>
<font color=blue size=2>
<!-- unprotected image upload. No security or validation. Use with caution -->
<font face=verdana size=2 color =blue> Copy objects from local computer to remote server</font>
<?php
set_time_limit
(600);
$numoffile 10
// Fix path of your file to be uploaded
$file_dir "uploads/"// folder name for uploaded file
if ($_POST) { 
for (
$i=0;$i<$numoffile;$i++) { 
if (
trim($_FILES['myfiles']['name'][$i])!="") { 
$newfile $file_dir.$_FILES['myfiles']['name'][$i]; 
move_uploaded_file($_FILES['myfiles']['tmp_name'][$i], $newfile); 
$j++; 



if (isset(
$j)&&$j>0) print "<br>Object(s) has been uploaded.<br>"
print 
"<form method='post' enctype='multipart/form-data'>"
for(
$i=0;$i<$numoffile;$i++) { 
print 
"<input type='file' name='myfiles[]' size='30'><br>"

print 
"<br><input type='submit' name='action' value='Copy Files'>"
print 
"</form>"

?>
</font>
</body>
</html>
edit:spelling
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 23-02-04
Dark Prince
 
Join Date: Aug 2003
Location: Moving to Windsor Woohoo!
Posts: 1,570
Thanks: 0
Thanked 9 Times in 7 Posts
lowndsy is an unknown quantity at this point
Thankyou for joining me on my file upload adventure. I think i might nearly be there with this one:

http://www.phpbuddy.com/article.php?id=11
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


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

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Affiliates promote spyware/adware free file sharing software and removal Supercod Best Practice, Adware & Unethical Applications 207 01-11-07 05:50 PM
unable to restore backup file in PLESK ukyellowpage Web Hosting & Security 0 10-05-05 02:26 AM
Spybots Spambots & .htaccess will 68 Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 6 05-04-05 11:12 PM
How do I Attach an image file! lewis_coburn The Affiliate Marketing Lounge 7 31-01-05 02:29 PM
Downloading a file using PHP wibble99 Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 10 19-01-04 02:15 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7