🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.golive.dynamic.content
6 messages
6 total messages Started by Jeremy_M._Cox Tue, 20 Jul 2004 03:57
Picture path is not being added to MySQL DB
#91
Author: Jeremy_M._Cox
Date: Tue, 20 Jul 2004 03:57
13 lines
1787 bytes
I posted this in another thread however I don't know if the name of the posting elicited a response maybe this time. PS I know that this is a user to user forum and just because no one helps right away that I should be impatience. Heck I am happy with help every one has supplied so far. So here it is again.

I followed the quicktime tutorial in the picture upload by Tim. The pictue uploads but the path doesn't get uploaded to the db.

I tried to pick apart the script and I guess this is the part that is supposed to do that:
// Tell the GL-Database-Engine the name and path to the uploaded file
//$_POST[$tf] = $_POST['upload_path'].$key."_".$_FILES[$key]['name'];

My question is how is this supposed to tell GoLive to upload this to the db?
Was I supposed to make changes to this part of the script. I read all 79 postings in the picture_upload thread. Some people had the same problem but the solution was never posted.

I am can figure out code by reading it. But since this has to interact with GoLive functions I don't know how to troubleshoot or fix this part.
Any help would be useful so I can move on to something else I can't figure out.
Re: Picture path is not being added to MySQL DB
#125
Author: rafele
Date: Thu, 12 Aug 2004 15:38
32 lines
1802 bytes
hi,

get a solution for this problem changing few line on the script;

my problem: had 2 folders named big and small within a folder img in the root directory of my site, so the uploaded pictures had this path img/big/ and the picture ../img/big/xxxx.jpg; [small instead of big for thumb:)]

my solution:
on line 142/143 in the original Tim's script [i didn't make any change to $HTTP_POST_VARS] where say

// create the destination path
		$destination = "../../".$upload_path.$key."_".$HTTP_POST_FILES[$key]['name'];

changed with

// create the destination path
$destination = "../../".$upload_path.$HTTP_POST_FILES[$key]['name'];

and after, on line 152/153 where say

// Tell the GL-Database-Engine the name and path to the uploaded file
		$HTTP_POST_VARS[$tf] = $upload_path.$key."_".$HTTP_POST_FILES[$key]['name'];

changed with

$HTTP_POST_VARS[$tf] = "../".$upload_path.$HTTP_POST_FILES[$key]['name'];

so this run,
now i'm looking for a solution for delete picture function because don't work ;
[either before]

ciao,
raf
Re: Picture path is not being added to MySQL DB
#141
Author: Jeremy_M._Cox
Date: Sun, 15 Aug 2004 06:30
27 lines
1818 bytes
raf,
OK I used your method and the path is being uploaded to the database. So thank you for that. Then I was having the same problem with the photo not being deleted. So I deleted the "@" symble in front of the "unlink" function. This symbols supresses error messages which made it hard to figure out what was wrong. This led to the following solution

Change line 81, which looks like this

// $del_p = "../../".$_POST[$df];

to this

$del_p = "../".$_POST[$df];

at least it worked for me I hope this helps. It seems the unlink function was looking for the wrong directory. For instance after your fixes, my directory

"../../images/photos/story_photos (the images photo was at the root level) "

was being uploaded to the data base. When I wanted to delete the file the script was looking for the photo at

"../../../images/photos/story_photos"

so in the photo_upload script I just erased one "../" now it looks for the photo at the correct directory which is

"../../images/photos/story_photos"

I hope this helps. Thank you very much for the initial help.

ciao right back,
Jeremy
Re: Picture path is not being added to MySQL DB
#142
Author: Jeremy_M._Cox
Date: Sun, 15 Aug 2004 06:33
9 lines
826 bytes
Sorry raf

In the previous post I said

"../../images/photos/story_photos (the images photo was at the root level) "

what I meant was

the 'Images" FOLDER was at the root level
Re: Picture path is not being added to MySQL DB
#144
Author: Jeremy_M._Cox
Date: Sun, 15 Aug 2004 07:47
17 lines
1105 bytes
Hopefully one final note Raf,

I also changed the following line in the delete section of the script

I changed line 101:

// $HTTP_POST_VARS[$df] = "&nbsp";

to

$HTTP_POST_VARS[$df] = "";

For some reason the original way didn't delete the path from the database.

FYI(for your information) I also have the "img source is relative to the site root" checked in the dynamic bindings palette.

So now all works. At least on my end.
Re: Picture path is not being added to MySQL DB
#182
Author: rafele
Date: Sun, 29 Aug 2004 13:22
20 lines
1313 bytes
hi Jeremy,

thank for suggestions, but the delete file function won't work yet;
my correct path for $del_p is

$del_p = $_POST["$df"];

infact i "echoed" $del_p under the error message [before the exit] and he print
../img/big/xxxx.jpg correctly;

if i try to remove the @ from unlink function i get only a blank page with error number 2 on page code;
if i check "img source is relative to the site root" in the dynamic bindings palette, nothing change :((

only a question:
when you say images folder was at the root level the path is ../../images/?

had the same img folder at the root level and the path is ../img is my fault?

ciao,
raf
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads