Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

image and mysql

Guest
Sep 23, 2009 Sep 23, 2009

Dear,

I am looking for some help on how to record information about an uploaded file in a database table. I want to create a upload directory in my site root, and have just the information of the uploaded file into my database (have in tabe, image_x.pnp and so on) the image_x.png represents the file that was uploaded,

thank you all,

romeo

TOPICS
Server side applications
808
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 24, 2009 Sep 24, 2009

romeo umulisa wrote:

I am using dreamweaver built in behavior, but also with additional self writing code when needed.

Dreamweaver's server behaviors don't handle file uploads, and the Insert Record server behavior uses information passed by the $_POST array, whereas the name of your image will be in the $_FILES array.

Although it's possible to edit the Insert Record server behavior code to handle an uploaded file, I think it's probably quicker and easier to hand code it.

// remove any spaces from t

...
Translate
Guide ,
Sep 23, 2009 Sep 23, 2009

Is this question related to the former Adobe Dreamweaver Developer Toolbox (ADDT) extension, or are you using Dreamweaver´s built-in server behaviours ?

Cheers,

Günter

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 23, 2009 Sep 23, 2009

I am using dreamweaver built in behavior, but also with additional self writing code when needed.

R.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 23, 2009 Sep 23, 2009

that´s why I´ll be moving this thread to the regular Dreamweaver Application Development forum ;-).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 24, 2009 Sep 24, 2009
LATEST

romeo umulisa wrote:

I am using dreamweaver built in behavior, but also with additional self writing code when needed.

Dreamweaver's server behaviors don't handle file uploads, and the Insert Record server behavior uses information passed by the $_POST array, whereas the name of your image will be in the $_FILES array.

Although it's possible to edit the Insert Record server behavior code to handle an uploaded file, I think it's probably quicker and easier to hand code it.

// remove any spaces from the file name

$file = str_replace(' ', '_', $_FILES['image']['name']);

// move the file to the upload directory

$success = move_uploaded_file($_FILES['image']['tmp_name'], $uploadDir .'/'. $file);

if ($success) {

  // insert the file name into the database

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines