За да вградите форма за качване в сайта си е необходимо да следвате следните прости стъпки!

1. Попълнете необходимите параметри

Задължителни полета

Конфигурация по избор

от до
от до
от до
Мини x Голям x
Мини x Голям x
Мини x Голям x


2. Поставете следния код в сайта си

Попълнете всички задължителни полета

3. Създайте обработващ скрипт за качените изображение

Този код трябва да е поставен във страниците отговарящи на "URL за препращане при успех" и "URL за препращане при грешка". Дадения пример е на PHP, но може да използвате език по ваш избор!

<?php
if ($_GET['uploaded']){
 // The user file was uploaded successfully
 $result = simplexml_load_file($_GET['4s_ok']); 
// the get avriable 4s_ok hold the URL on which the
// result of the upload is located (in XML format)
echo "<p>Your image is called {$result->file[0]->name}.
It is
{$result->file[0]->size} bytes big
and is
{$result->file[0]->format}</p>"; echo "<p>And here it is: {$result->file[0]->embed->website}</p>"; // You can also save the link (in DB) so
// it can be embeded in dynamic pages later on
} elseif ($_GET['error']){ $error = simplexml_load_file($_GET['4s_error']); echo "<p class='error'>Your image failed to upload with
message
{$error->file[0]['error']}</p>"; echo "<p>The attempted file upload is called {$error->file[0]->name}.
It is
{$error->file[0]->size} bytes big
and is
{$error->file[0]->format}</p>"; } ?>
Правила за ползване | Често задавани въпроси | Помощ | Връзка с нас
Created by Mediaone | Copyright © 2007 4storing.com