<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.paradisesgarage.com:443/mcweb2/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Tech Support</title><link>https://www.paradisesgarage.com:443/mcweb2/forums/34.aspx</link><description>Having problems with your computer or game? Discuss it here! We may even help you fix your computer!</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Re: upload few files and have them rename with rand() php coding</title><link>https://www.paradisesgarage.com:443/mcweb2/forums/thread/3536.aspx</link><pubDate>Wed, 08 Dec 2010 17:34:25 GMT</pubDate><guid isPermaLink="false">b2ff3ccb-892e-4ceb-9a77-e4f6e73f7f60:3536</guid><dc:creator>SnakZ</dc:creator><slash:comments>0</slash:comments><comments>https://www.paradisesgarage.com:443/mcweb2/forums/thread/3536.aspx</comments><wfw:commentRss>https://www.paradisesgarage.com:443/mcweb2/forums/commentrss.aspx?SectionID=34&amp;PostID=3536</wfw:commentRss><description>&lt;p&gt;for me the thing is i dont know how to code in php lol its a video uploader thing so im trying to make sure that videos that are uploaded cant&amp;nbsp;overwrite&amp;nbsp;the other &amp;nbsp;what if u have let say 200 videos and one gets overwrite its going to be harder to tell what one it was&lt;/p&gt;
&lt;p&gt;one way i was thinking of is to use random plus a&amp;nbsp;&lt;em&gt;timestamp some how this one guy made it so the file name stayed with it not sure how he did it lol&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;he talked about using a md5 ? not sure how to use that yet lol&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: upload few files and have them rename with rand() php coding</title><link>https://www.paradisesgarage.com:443/mcweb2/forums/thread/3535.aspx</link><pubDate>Wed, 08 Dec 2010 17:04:26 GMT</pubDate><guid isPermaLink="false">b2ff3ccb-892e-4ceb-9a77-e4f6e73f7f60:3535</guid><dc:creator>ParaDOX</dc:creator><slash:comments>0</slash:comments><comments>https://www.paradisesgarage.com:443/mcweb2/forums/thread/3535.aspx</comments><wfw:commentRss>https://www.paradisesgarage.com:443/mcweb2/forums/commentrss.aspx?SectionID=34&amp;PostID=3535</wfw:commentRss><description>&lt;p&gt;Easiest way to rename files is to just name them sequentially, instead of random. Which unless you make the number large enough you will always risk duplicate names.&lt;/p&gt;
&lt;p&gt;Start with any number you want then just add 1 to it. You will need to be able to either read the file names from the file system or store the &amp;quot;Seed&amp;quot; in a database or file. You can&amp;#39;t just store it in memory because when you restart the web app memory will be cleared. It requires a persistent store.&lt;/p&gt;
&lt;p&gt;You would use a random file name if you were generating a one time use download link to a file. in that case you would make an internal reference to the real file name and the random one. once the file is downloade delete the reference.&lt;/p&gt;
&lt;p&gt;I hope this helps you out!&lt;/p&gt;
&lt;p&gt;Feel free to jump in the Teamspeak server if you need any of it clarified.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: upload few files and have them rename with rand() php coding</title><link>https://www.paradisesgarage.com:443/mcweb2/forums/thread/3534.aspx</link><pubDate>Tue, 07 Dec 2010 20:58:06 GMT</pubDate><guid isPermaLink="false">b2ff3ccb-892e-4ceb-9a77-e4f6e73f7f60:3534</guid><dc:creator>SnakZ</dc:creator><slash:comments>0</slash:comments><comments>https://www.paradisesgarage.com:443/mcweb2/forums/thread/3534.aspx</comments><wfw:commentRss>https://www.paradisesgarage.com:443/mcweb2/forums/commentrss.aspx?SectionID=34&amp;PostID=3534</wfw:commentRss><description>&lt;p&gt;
&lt;p&gt;using the code in this way look like it worked for me only thing now is how to make it look to see if the file type is right lol&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Change: i used the form from the e-how site then used the codes for renaming but with the other part of it i just rename all the lines of codes with a &amp;quot;z&amp;quot; lol what in the end made it work but i recall that i try this before and it didnt work ...hmm idk but whatever it works&lt;/p&gt;
&lt;p&gt;if you know of any better way to do this then plz tell :)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;blockquote style="overflow-x: scroll;"&gt;&lt;pre style="margin: 0px;"&gt;&lt;/p&gt;
&lt;p&gt;$ext = findexts &amp;nbsp;($_FILES[&amp;#39;file&amp;#39;][&amp;#39;name&amp;#39;]) ;&lt;/p&gt;
&lt;p&gt;$extz = findexts &amp;nbsp;($_FILES[&amp;#39;filez&amp;#39;][&amp;#39;name&amp;#39;]) ;&lt;/p&gt;
&lt;p&gt;$ran = rand () ;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;$ranz = rand () ;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;$ran2 = $ran.&amp;quot;.&amp;quot;;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;$ran2z = $ranz.&amp;quot;.&amp;quot;;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;$target = &amp;quot;upload/&amp;quot;;&lt;/p&gt;
&lt;p&gt;$target = &amp;quot;upload/&amp;quot;;&lt;/p&gt;
&lt;p&gt;$target = $target . $ran2.$ext;&lt;/p&gt;
&lt;p&gt;$target = $target . $ran2z.$extz;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if(move_uploaded_file($_FILES[&amp;#39;file&amp;#39;][&amp;#39;tmp_name&amp;#39;], $target)) {&amp;nbsp;&lt;/p&gt;
&lt;p&gt;echo &amp;quot;The file has been uploaded as &amp;quot;.$ran2.$ext;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;} else {&amp;nbsp;&lt;/p&gt;
&lt;p&gt;echo &amp;quot;Sorry, there was a problem uploading your file.&amp;lt;br&amp;gt;&amp;quot;;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;if(move_uploaded_file($_FILES[&amp;#39;filez&amp;#39;][&amp;#39;tmp_name&amp;#39;], $target)) {&amp;nbsp;&lt;/p&gt;
&lt;p&gt;echo &amp;quot;The file has been uploaded as &amp;quot;.$ran2z.$extz;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;} else {&amp;nbsp;&lt;/p&gt;
&lt;p&gt;echo &amp;quot;Sorry, there was a problem uploading your file.&amp;quot;;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>upload few files and have them rename with rand() php coding</title><link>https://www.paradisesgarage.com:443/mcweb2/forums/thread/3533.aspx</link><pubDate>Tue, 07 Dec 2010 17:52:25 GMT</pubDate><guid isPermaLink="false">b2ff3ccb-892e-4ceb-9a77-e4f6e73f7f60:3533</guid><dc:creator>SnakZ</dc:creator><slash:comments>0</slash:comments><comments>https://www.paradisesgarage.com:443/mcweb2/forums/thread/3533.aspx</comments><wfw:commentRss>https://www.paradisesgarage.com:443/mcweb2/forums/commentrss.aspx?SectionID=34&amp;PostID=3533</wfw:commentRss><description>&lt;p&gt;Ok para u always been the come to guy for things like this so how about u ? lol and any one who think they may know how to code this together &lt;/p&gt;
&lt;p&gt;I have 2 sites here that does what i need them to do but i dont know how to put the 2 codes together&amp;nbsp;&lt;img class="inlineimg" title="Frown" border="0" src="http://phpbuilder.com/board/images/smilies/frown.gif" alt="" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i got it to upload all files and used rand() to give the files a # but it ends up giving them all the same # lol so they&amp;nbsp;overwrite&amp;nbsp;them selfs lol&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This site shows how to upload mltiple fiels with php.&lt;br /&gt;&lt;a target="_blank" href="http://www.ehow.com/how_6345068_upload-multiple-files-php.html" rel="nofollow"&gt;http://www.ehow.com/how_6345068_uplo...files-php.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This site shows how to rename only 1 file uploaded with rand()&lt;br /&gt;&lt;a target="_blank" href="http://php.about.com/od/advancedphp/ss/rename_upload.htm" rel="nofollow"&gt;http://php.about.com/od/advancedphp/...ame_upload.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;i pray this is not to hard to do and if any one gets bored after words can you show how to block a file type from being&lt;br /&gt;uploaded ? like php/exe types&lt;br /&gt;&lt;br /&gt;PS)i would call my self a php newbe lol and ty you for your time and help&lt;br /&gt;&lt;br /&gt;Code from&amp;nbsp;&lt;a target="_blank" href="http://php.about.com/od/advancedphp/ss/rename_upload.htm" rel="nofollow"&gt;http://php.about.com/od/advancedphp/...ame_upload.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;div&gt;
&lt;div class="smallfont"&gt;&lt;blockquote style="overflow-x: scroll;"&gt;&lt;pre style="margin: 0px;"&gt;&lt;/div&gt;
&lt;pre dir="ltr" class="alt2"&gt;&amp;lt;form enctype=&amp;quot;multipart/form-data&amp;quot; action=&amp;quot;upload.php&amp;quot; method=&amp;quot;POST&amp;quot;&amp;gt; 
Please choose a file: &amp;lt;input name=&amp;quot;uploaded&amp;quot; type=&amp;quot;file&amp;quot; /&amp;gt;&amp;lt;br /&amp;gt; 
&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Upload&amp;quot; /&amp;gt; 
&amp;lt;/form&amp;gt; 


//This function separates the extension from the rest of the file name and returns it  
function findexts ($filename) 
{ $filename = strtolower($filename) ; 
$exts = split(&amp;quot;[/\\.]&amp;quot;, $filename) ; 
$n = count($exts)-1; $exts = $exts[$n]; 
return $exts; 
} 

//This applies the function to our file  
$ext = findexts ($_FILES[&amp;#39;uploaded&amp;#39;][&amp;#39;name&amp;#39;]) ;

//This line assigns a random number to a variable. You could also use a timestamp here if you prefer.  
$ran = rand () ; 
//This takes the random number (or timestamp) you generated and adds a . on the end, so it is ready of the file extension to be appended. 
$ran2 = $ran.&amp;quot;.&amp;quot;; 
//This assigns the subdirectory you want to save into... make sure it exists! 
$target = &amp;quot;images/&amp;quot;;
//This combines the directory, the random file name, and the extension 
$target = $target . $ran2.$ext; 
if(move_uploaded_file($_FILES[&amp;#39;uploaded&amp;#39;][&amp;#39;tmp_name&amp;#39;], $target)) { 
echo &amp;quot;The file has been uploaded as &amp;quot;.$ran2.$ext; } 
else { 
echo &amp;quot;Sorry, there was a problem uploading your file.&amp;quot;; 
}&lt;/pre&gt;
&lt;pre dir="ltr" class="alt2"&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/pre&gt;
&lt;/div&gt;
The code from&amp;nbsp;&lt;a target="_blank" href="http://www.ehow.com/how_6345068_upload-multiple-files-php.html" rel="nofollow"&gt;http://www.ehow.com/how_6345068_uplo...files-php.html&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div class="smallfont"&gt;&lt;blockquote style="overflow-x: scroll;"&gt;&lt;pre style="margin: 0px;"&gt;&lt;/div&gt;
&lt;pre dir="ltr" class="alt2"&gt; 
&amp;lt;form action=&amp;quot;upload.php&amp;quot; method=&amp;quot;post&amp;quot; enctype=&amp;quot;multipart/form-data&amp;quot;&amp;gt;
File: &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;file[]&amp;quot;/&amp;gt;&amp;lt;br/&amp;gt;
File: &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;file[]&amp;quot;/&amp;gt;&amp;lt;br/&amp;gt;
File: &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;file[]&amp;quot;/&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;Upload&amp;quot;/&amp;gt;
&amp;lt;/form&amp;gt;



$destpath = &amp;quot;upload/&amp;quot; ;


while(list($key,$value) = each($_FILES[&amp;quot;file&amp;quot;][&amp;quot;name&amp;quot;])) {
if(!empty($value)){
f ($_FILES[&amp;quot;file&amp;quot;][&amp;quot;error&amp;quot;][$key] &amp;gt; 0) {
echo &amp;quot;Error: &amp;quot; . $_FILES[&amp;quot;file&amp;quot;][&amp;quot;error&amp;quot;][$key] . &amp;quot;&amp;lt;br/&amp;gt;&amp;quot; ;
}
else {
$source = $_FILES[&amp;quot;file&amp;quot;][&amp;quot;tmp_name&amp;quot;][$key] ;
$filename = $_FILES[&amp;quot;file&amp;quot;][&amp;quot;name&amp;quot;][$key] ;
move_uploaded_file($source, $destpath . $filename) ;
echo &amp;quot;Uploaded: &amp;quot; . $destpath . $filename . &amp;quot;&amp;lt;br/&amp;gt;&amp;quot; ;
}
}
}&lt;/pre&gt;
&lt;pre dir="ltr" class="alt2"&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>