FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old December 2nd, 2000, 11:31 PM
stujohnson stujohnson is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Posts: 61 stujohnson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
I have a shopping cart that the owner will enter/edit inventory through an admin page. This all works but I wish to add a feature that would not require opening a seperate ftp program to upload the picture. I have investigated upload and ftp functions but don't know which way to go. I want the uploaded picture to be named xyz.gif (for product number xyz) automatically so the owner can't mess things up.

That said, is either one of these methods better than the other for this type of job?

Thanks

[This message has been edited by stujohnson (edited December 02, 2000).]

Reply With Quote
  #2  
Old December 3rd, 2000, 03:29 AM
Robert_J_Sherman
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
you can always use a "file" field, and simply copy the selected file to the desired directory, for product pics.

you can set a number of things by doing this, such as the files name, and what file mimes are acceptable, etc..

Here's an example that I use to upload a banner image and store the file in a folder, and record the files name in a database.

this is all done from a simple web form.

#validate image_url
if ($banner && ($image_url != "none")) {
$imagename = $image_url_name;
$imagesize = $image_url_size;
$imagetype = $image_url_type;
$size = GetImageSize($image_url);

//verify appropriate MIME type
$validmime = 0;
for ($i = 0; $i < count($valid_mime); $i++) {
if ($valid_mime[$i] == $imagetype) {
$validmime = 1;
}
}
#Check Top HxW
if ($placement == "T" && $size[1] > $image_max_height) {
//image is too tall//
$missing_fields[] = "InvalidBanner";
$image_url_error[] = "The Banner Image is $size[1] pixels high, this height is not accepted, please try again.";
}
if ($placement == "T" && $size[0] > $image_max_width) {
//image is too wide//
$missing_fields[] = "InvalidBanner";
$image_url_error[] = "The Banner Image is $size[0] pixels wide, this width is not accepted, please try again.";
}
#Check Side HxW
if ($placement == "S" && $size[1] > $image_max_height2) {
//image is too tall//
$missing_fields[] = "InvalidBanner";
$image_url_error[] = "The Banner Image is $size[1] pixels high, this height is not accepted, please try again.";
}
if ($placement == "S" && $size[0] > $image_max_width2) {
//image is too wide//
$missing_fields[] = "InvalidBanner";
$image_url_error[] = "The Banner Image is $size[0] pixels wide, this width is not accepted, please try again.";
}
if ($validmime == 0 | | $imagesize > $MAX_FILE_SIZE) {
//appropriate mime not found//
if ($validmime == 0) {
$missing_fields[] = "InvalidBanner";
$image_url_error[] = "The Banner Image is of ($imagetype), this type of image is not accepted, please try again.";
}
//compare the selected upload file to the max value//
if ($imagesize > $MAX_FILE_SIZE) {
$missing_fields[] = "InvalidBanner";
$image_url_error[] = "The Banner Image ($imagename) you provided does not match our file size criteria, please try again.";
}
}
if (!$missing_fields) {
$imagename = date("U", time())."-".$imagename;
if ($win32 == "Y") {
if(!copy(stripslashes($image_url), $image_path.$imagename)) {
$missing_fields[] = "InvalidBanner";
$image_url_error[] = "I was unable to upload your banner ($imagename) to the server, please try again.";
}
else {
$image_url = $imagename;
}
}
else {
if(!copy($image_url, $image_path.$imagename)) {
$missing_fields[] = "InvalidBanner";
$image_url_error[] = "I was unable to upload your banner ($imagename) to the server, please try again.";
}
else {
$image_url = $imagename;
}
}
}
}


------------------
SnR Graphics,
Low Cost Hosting and Web Development.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > uploading / ftp question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway