If you have access to the directory /home/finchers/public_html/dynamic/ make sure to CHMOD it before trying this (chmod 755 will work)
I'm trying to find the code that contains this line...
Which file and line number does it get placed or replaced in?
I'm assuming the upload_class.php, right??
you need to do that via the ftp client, which ftp client are you using?
I use dreamweaver to ftp upload. But I can change the file permissions by logging in to Vdeck (web admin).
Community Supporter?
What a dork
Gender:
Posts: 16
100 credits Members referred : 0
www.darrene.com - bloated flash site!
« Reply #23 on: Apr 05, 2007, 12:11:00 AM »
Ok, I CHMOD the directory that contains the upload_class.php file and now I am getting an image- it looks like the Thumbnail image and the file name given is 1175721359.jpg
Now, I'm getting this message-
Code:
Warning: chmod(): Inappropriate file type or format in /home/finchers/public_html/images/upload/upload_class.php on line 131
I'm one step closer to success!!!
Also, how can I modify the code where no matter what, it saves the file as " image1 "
Community Supporter?
What a dork
Gender:
Posts: 16
100 credits Members referred : 0
www.darrene.com - bloated flash site!
« Reply #24 on: Apr 05, 2007, 12:21:13 AM »
Everything works now. The CHMOD of the folder is what was keeping me from successfully modifying the image and saving to the folder.
All I need is one last request and then you'll be done with me! (I *REALLY* appreciate all the help!!)
How can I make this where no matter what file gets uploaded, it gets named to " image1.jpg " and over-writes the previous version of image1.jpg?
I have the restrictions set to where you can ONLY upload a .jpg image- this setting is the ABSOLUTE last thing that needs to be done for what I need this script to do!
« Last Edit: Apr 05, 2007, 12:33:56 AM by Darren_E »
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8266
42583 credits Members referred : 3
« Reply #25 on: Apr 05, 2007, 12:33:31 AM »
I guess you will have to rename the file in the upload process (Olaf will tell you how, I am not familiar with his class) and the delete the old file with the unlink function
I guess you will have to rename the file in the upload process (Olaf will tell you how, I am not familiar with his class) and the delete the old file with the unlink function
everything is included in the class
darren check this code to learn how to use the example:
Sort of clear (PHP is definitely NOT Flash ActionScript!!)
Landscape only = true (Yes, I do need it as a landscape only) Thumbnail = FALSE (I don't need a thumbnail) Delete tmp = true (no need for the tmp file) Compression = 80 (80 works just fine for my application)
Here is how I am using your script-
1. User logs into his website to post a picture of a vehicle. This vehicle is the Special of the week. 2. Image gets resized to a specific 370 x 260 image size.
That part works- now all I need is THIS-
3. Image gets named as " image1.jpg " no matter what the file name was before since several people at this dealership will be uploading a photo for the "Special of the week."
4. Flash 9 document dynamically loads image1.jpg from server and displays it on the website. This works but is set to load ONLY " image1.jpg " and nothing else.
That's why I need to rename the uploaded file to image1.jpg and overwrite the previous image.
« Last Edit: Apr 05, 2007, 01:17:40 AM by Darren_E »
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8266
42583 credits Members referred : 3
« Reply #28 on: Apr 05, 2007, 01:38:52 AM »
I've noticed these two attributes in Olaf's class :
var $rename_file; // if this var is true the file copy get a new name
var $file_copy; // the new name
So if you change that to this :
var $rename_file = true;
var $file_copy = 'image1.jpg';
Is this working? If not post the code you are using.
Community Supporter?
What a dork
Gender:
Posts: 16
100 credits Members referred : 0
www.darrene.com - bloated flash site!
« Reply #29 on: Apr 05, 2007, 01:54:33 AM »
I think this did it....(Still testing it...)
Once again, I can't thank you enough for the assistance.
Code:
function file_upload() { $this->language = "en"; // choice of en, nl, es $this->rename_file = true; $this->ext_string = ""; } function show_error_string() { $msg_string = ""; foreach ($this->message as $value) { $msg_string .= $value."<br />\n"; } return $msg_string; } function set_file_name($new_name = "image1") { // this "conversion" is used for unique/new filenames if ($this->rename_file) { if ($this->the_file == "") return; $name = ($new_name == "") ? strtotime("now") : $new_name; sleep(3); $name = $name.$this->get_extension($this->the_file); } else { $name = str_replace(" ", "_", $this->the_file); // space will result in problems on linux systems } return $name; } function upload($to_name = "image1") { // change back to "" if fail $new_name = $this->set_file_name($to_name); if ($this->check_file_name($new_name)) { if ($this->validateExtension()) { if (is_uploaded_file($this->the_temp_file)) { $this->file_copy = $new_name; if ($this->move_upload($this->the_temp_file, $this->file_copy)) { $this->message[] = $this->error_text($this->http_error); if ($this->rename_file) $this->message[] = $this->error_text(16); return true;
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8266
42583 credits Members referred : 3
« Reply #30 on: Apr 05, 2007, 01:56:33 AM »
No worries man. We started from zero knowledge too