Okay I have a html upload form here, What is does is displays a browse button so users can upload files to my site, what I want them to be able to do is completly rename the file that they are uploading once they upload it to my site, but always add the extensions .mp4, so say I upload a video named sample123.mp4 and I rename the video to funny. I want the file to be saved in my directory as funny.mp4. But be saved into my database table as funny. <?PHP require_once("./include/membersite_config.php"); if(!$fgmembersite->CheckLogin()) { $fgmembersite->RedirectToURL("login.php"); exit; } ?> <!DOCTYPE …

Member Avatar
Member Avatar
+0 forum 3

Hello Daniweb, I have manage to create codes that could upload a image that is purposely to serve as profile picture of a certain student. My problem is how to rename it to aN AUTO COLLATE UNIQUE ID NUMBER so that i can display it specifically to a certain student account which bears the unique id number. The variable is $student_id <?php session_start(); $session_id = $_SESSION['user_id']; if($session_id == null){ header("location:Student_Edit.php"); die(); } include 'Connect.php'; $flag = ""; $result = mysql_query("SELECT * FROM student_information where student_id='{$_SESSION['user_id']}'",$link_id);; $data = mysql_fetch_array($result); ?> <div class="style3" > <?php $uploadpath = 'upload/'; $max_size = 2000; $alwidth …

Member Avatar
Member Avatar
+0 forum 3

Hi I want to rename Image in this script after downloading ,now it downloads as default Want to rename it to x.png Any help appreciated Saw a way via PHPserver,but Im using JAVA App <html> <head> <script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/rgbcolor.js"></script> <script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/canvg.js"></script> <script> function getImgData(chartContainer) { var chartArea = chartContainer.getElementsByTagName('svg')[0].parentNode; var svg = chartArea.innerHTML; var doc = chartContainer.ownerDocument; var canvas = doc.createElement('canvas'); canvas.setAttribute('width', chartArea.offsetWidth); canvas.setAttribute('height', chartArea.offsetHeight); canvas.setAttribute( 'style', 'position: absolute; ' + 'top: ' + (-chartArea.offsetHeight * 2) + 'px;' + 'left: ' + (-chartArea.offsetWidth * 2) + 'px;'); doc.body.appendChild(canvas); canvg(canvas, svg); var imgData = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream"); canvas.parentNode.removeChild(canvas); return imgData; …

Member Avatar
+0 forum 0

Hi Everyone, Wanted to share a bit on this subject as I've had to recently make some of these changes. Along my way I found a few sites that basically suggested moving all mailboxes off the database, dismount, delete and create a new database. Simple enough, however I didn't want to do this. As you may or may not know, by default Exchange installs the database at the following location: C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\Database1\Database1.edb Log files would go: C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\Database1 What if you wanted to change the location or name of those files? Well thankfully this is super easy with …

Member Avatar
+0 forum 0

Hi everyone. It's been a while since I've needed help with a PHP problem. Hopefully someone here knows what I'm doing wrong because I can't see it. I am trying to use rename() to rename an image file which is in a subdirectory of a subdirectory the script is running in. The script is running in "/folder" and the images are held in "/folder/images/general" The script I currently have is: $old = "./images/general/item2.jpg"; $new = "./images/general/item44.jpg"; if(file_exists($old)) { rename($old, $new); echo "yes"; } else { echo "no"; } The if statement is finding the file as my browser is outputting …

Member Avatar
Member Avatar
+0 forum 9

HI, how can i change column name by query? Exm: UPDATE table_name SET column_name='course_title' WHERE coulumn_name='course_name'; is it?

Member Avatar
Member Avatar
+0 forum 2

What's sql syntax to change database name ? I tried this: ALTER DATABASE name RENAME TO new_name It doesn't work.

Member Avatar
Member Avatar
+0 forum 6

Hello All, This may be the wrong place for this and if so I apologize in advance. I have been tasked with organizing a drive full of marketing assets on a mac server. It is currently in use so we have made a duplicate share so that any changes will not confuse the users and no more assets will be randomly added. The assets stored are in no way, shape, or form named or placed in a meanignful manner and they are also stored either in folders stored in folders stored in folders or just sitting outside of a folder. …

Member Avatar
Member Avatar
+0 forum 1

Hello Daniweb, I need to write a program to change the extension of all the files in a folder from a certain extension to another. My code is shown below, however, I have one problem: i.e. Say we want to change all files with the extension "*.tx" to "*.txt" but there are two files of the same name but one file ends with "*.tx" and the other ends with "*.txt" ****************************(in the folder: one.txt and one.tx)******************* Now I have to rename the "*.txt" file after it has been changed to the "*.txt" file...**** How can I do this correctly and …

Member Avatar
Member Avatar
+0 forum 10

What we have done was : Specifying valid FTP remote server name, a username and a password if password required in their relevant textboxes on the form then we click on connect, we notice that the TreeView control is filled with main directories while ListBox control is filled with main files root, that required setting up the Treeview first in the Design-Time (IDE) then we did the same to the ListBox control as well to correctly receive data returned from the FTP remote server. While recieving the data we've changed the cursor shape beside tracking down the ftp server status …

Member Avatar
+0 forum 0

Hi, I am trying to write a Bash Script to sort some images but I am new to Bash and not having any luck. I have a folder of images. Example: P100.jpg P172.jpg P342.jpg P400.png I need to change these filenames to <filename>_DEFAULT<extension>. ie. P100_DEFAULT.jpg and then move the file into a folder with the name of the original file. Pseudo: Load file list for directory For each file in the directory: { filename = <filename> newfilename = <filename>_DEFAULT<extension> mkdir <filename> #if directory doesn't exist mv <filename> <newdir/newfilename> } **NOTE: I will be running the script on MacOSX** (BASH 3.2) …

Member Avatar
Member Avatar
+0 forum 1

Hello, I currently have a script that Uploads an image, resizes and saves successfully. I am having trubble understanding how I would rename the uploaded image according to the other image names in the directory. For example there are 3 images in the directory (Image1.png, Image2.gif and Image3.jpg) How would I be able to rename the next image that is uploaded to Image4.png or Image4.jpg or Image4.gif (depending on upload extention) automaticly without having to change the name before upload, and so on for later uploads (Image5, 6, 7, etc.)? Here is my code: <?php error_reporting(0); $change=""; $abc=""; define ("MAX_SIZE","999999"); …

Member Avatar
Member Avatar
+1 forum 3

Hi, I am trying to write a Bash Script to sort some images but I am new to Bash and not having any luck. I have a folder of images. Example: P100.jpg P172.jpg P342.jpg P400.png I need to change these filenames to <filename>_DEFAULT<extension>. ie. P100_DEFAULT.jpg and then move the file into a folder with the name of the original file. Pseudo: Load file list for directory For each file in the directory: { filename = <filename> newfilename = <filename>_DEFAULT<extension> mkdir <filename> #if directory doesn't exist mv <filename> <newdir/newfilename> } **NOTE: I will be running the script on MacOSX** (BASH 3.2) …

Member Avatar
Member Avatar
+0 forum 2

Hi Apologies if this is not the correct forum for this question. I am running xampp. I have 100+ image files in a directory that I wish to rename. The old filename and the new filename are stored in an mysql database I want to write a routine that will rename the files based on this information. It is only the filename not the extension that will change although currently the filename (old and new)in the database includes the extension My 'variables' (I use the term very loosely as I am a php newbie) database name database user database password …

Member Avatar
Member Avatar
+0 forum 10

Hello DaniWeb, I have a new idea for an app: I have an external harddrive and I usually backup my desktop with a cleanup folder which I usually move to the external harddrive. The problem is: when I search for a file (i.e. example.mp3) I will find multiple copies which are taking up way too much space. Is there an app or some code that can search for an extension (i.e. .mp3) and if it finds more than one copy of the same file, it can delete the extra file? The reason I ask is: I have around 1300 different …

Member Avatar
Member Avatar
+0 forum 12

Hi every one well i have this problem: Im creating a method for multiplying two different lists sorted in arrays example: MyList a [9,9,9,9] * MyList B[1,1,9] the problem is that i was told not to convert to a large int and then multiply like this 9999*9 +9999*1+9999*9 Since the objective is to use array Lists i already figure out that i have to take the firs number of one of the array's multiply it by each number on the second list (array) and stored each individual result in a new array and then use the method AddList (that i …

Member Avatar
Member Avatar
+0 forum 2

Hi Guys, How's your day? I would like to ask, since I'm a beginner in vb .net, I can't figure this out. Here's the scenario: I have a folder with lots of folders inside and inside those folders are .tif files. I want to create a program that will rename those images based from the list from my text file. Here's the content of my text file: Filename: woutbar.txt Code: [CODE] 1.tif 2.tif 2_001.tif 3.tif 3_001.tif 4.tif 4_001.tif 5.tif 5_001.tif 6.tif 6_001.tif 7.tif 7_001.tif 8.tif 8_001.tif[/CODE] Filename: withbar.txt Code: [CODE] 1.tif 1_001.tif 2.tif 2_001.tif 3.tif 3_001.tif 4.tif 4_001.tif 5.tif 5_001.tif …

Member Avatar
Member Avatar
+0 forum 10

I have a large number of files that begin with numbers (e.g., 10admin_boundary_x) and would like to rename the files so that they do not begin with a digit (e.g., admin_boundary_x). I am working with shapefiles (.shp, .shx, .dbf, etc) and thought a python script could save me some time. I haven't quite figured it out yet, but here is the code I've got so far: [CODE]import os #read in file from the directory for filename in os.listdir("."): f = open(filename, "w") i = True while i: #if filename starts with a digit, lose first index by renaming and #try …

Member Avatar
Member Avatar
+0 forum 6

New user to Daniweb in the hope i can get some help cus my brain is fried. Im relitively a n00b at php but i can handle the basics, working with images is beyond me at the moment but im learning. I have the below code, which works. it uploads image, renames and adds data to my sql database all fine as well as running checks on filesize, extensions etc. What i wanted to do next was to resize the file in proportion to a dedicated set width. But at same time create a copy of the file and change …

Member Avatar
Member Avatar
+0 forum 1

hi ihave many files like File.txt anotherfile.txt Log.txt . Etc... And i want to rename these files into something like this File1.txt File2.txt File3.txt . Etc So how can i do this in c# Thank you for your help

Member Avatar
Member Avatar
+0 forum 2

How i can prevent someone to rename a folder?

Member Avatar
Member Avatar
+0 forum 1

I started writing a python script to rename files. I wanted it to be able to rename multiple files in a given directory. I started off trying to use rename but then found other options Can't quite get it to happen. Hope my code is understandable, can anyone assist in why it doesn't work? [CODE]""" To take input from user (directory and characters) read files in a directory and remove characters(word) from the filenames in that directory so for c:\somedirectory\lovelyname_annoying_chars.txt return c:\somedirectory\lovelyname.txt input input --> dir/name.ext""" import os # get the directory from user targetfolder = raw_input('enter a target folder:\n').strip() …

Member Avatar
Member Avatar
+0 forum 5

Hello everyone! I'm wondering if there is a way to assign the values of a column in SQL as the key name in a multidimensional array. Here is what I have, my database looks like this: Table Name = SJCFPCB date | totalin | cdulep | icu | ----------------------------------- 2011-01-27 | 30 | 5 | 4 2011-01-11 | 28 | 4 | 5 2010-12-11 | 31 | 7 | 6 Here is the query I'm using to get the data: [CODE]$sql = "SELECT * , convert(CHAR, \"date\", 10) AS ndate from dbo.SJCFPCB where 30 > DATEDIFF(d,\"date\", GETDATE())"; $result=odbc_exec($conn1, $sql); $DATA=array(); …

Member Avatar
Member Avatar
+0 forum 2

Hi all Please help me in this problem: Suppose i have hundreds of files in one directory with different extenshions, I want to rename all filenames. [COLOR="Green"]filename[/COLOR] required filename [COLOR="Green"]XYZ[/COLOR]bla.java with [COLOR="Red"]ABC[/COLOR]bla.java [COLOR="Green"]Xyz[/COLOR]bla.java with [COLOR="Red"]Abc[/COLOR]bla.java [COLOR="Green"]xyz[/COLOR]bla.htm with [COLOR="Red"]abc[/COLOR]bla.htm please tell me about shell script for this. regards Abid

Member Avatar
Member Avatar
+0 forum 1

Hi Dear All I have 1000s of JPGs Images. Names like S-KHI-1233 Now I need To rename all the images and new name should be last 4 numeric digits like 1233. For all 1000 JPGs I want to do this. if image name is S-KHI-1964 then new name should be 1964 and if name S-LAK-1854 then new name should be 1854.

Member Avatar
Member Avatar
+0 forum 11

The End.