OVH Community, votre nouvel espace communautaire.

ps upload


tofinger
17/05/2008, 10h12
Bonjour Michel!

je place la partie haute du code qui est a modifiée par l'utilisateur.

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello World\n";

# Installation Instructions
# http://www.perlservices.net/en/progr...rs_guide.shtml

# To order a custom installation
# https://www.perlscriptsjavascripts.c...tallation.html

################################################## ##################
#
# PS Upload
# )2002, PerlServices.net
#
# Requires: Perl5+
# Created: March 12, 2002
# Author: PerlServices
# Version: 4.1
#
# This script / program is copyright material!
#
################################################## ##################
# Start PS Upload Configuration
################################################## ##################

# ================================================== ============== #
# Var: $send_mail_path
# ================================================== ============== #
# for unix/linux servers only. enter your server's sendmail path.
# it usually looks something like :
# /usr/sbin/sendmail or
# /usr/lib/sendmail

$send_mail_path = "/usr/sbin/sendmail";

# ================================================== ============== #
# Var: $smtp_path
# ================================================== ============== #
# for windows servers only. enter your server's mail program path.
# it usually looks something like :
# mail.yourdomainname.com or
# smtp.yourdomainname.com

# note: if you set a value in the next variable, it will be used in
# place of the $send_mail_path . Leave blank if you uploaded this
# script to a linux, unix or mac type server with sendmail, qmail
# or postfix installed

$smtp_path = "";

# if your SMTP server requires authentication, enter the email
# account's username and password below
$smtp_user = "";
$smtp_pass = "";

# ================================================== ============== #
# Var: $notify
# ================================================== ============== #
# if you would like to be notified of uploads, enter your
# email address between the SINGLE quotes. if you do not wish
# to be notified, leave this blank. only one e-mail address can
# be set here

$notify = 'postmaster@allprint-france.fr';

# ================================================== ============== #
# Var: $adminName
# ================================================== ============== #
# your name. the name that appears in the To: header in the e-mail
# sent to the address specified in the $notify variable. enter the
# name between the single quotes.

$adminName = 'PS Upload';

# ================================================== ============== #
# Var: $subject
# ================================================== ============== #
# the subject of the e-mail notification. if you have a field in
# your form named "subject" in lowercase, that will over-ride this

$subject = 'Upload Form Submission';

# ================================================== ============== #
# Var: $dir
# ================================================== ============== #
# enter your server's path (not your website address) to the
# directory files will be uploaded to.
# note : this script does not auto-delete uploaded files.
# consider one of our other scripts if auto-deletion is required
#
# on most unix/linux server $ENV{DOCUMENT_ROOT}/ points to the
# folder your homepage resides in. however, sometimes you need to
# also add www or htdocs to the path
#
# on windows servers, start the path with the drive letter and
# separate each folder with two backslashes.
# e.g. $dir = "F:\\webpath\\wwwroot\\uploads
#
# if you get this wrong, the script will print the correct path

$dir = "/home/allprint-france/www/fichiersclient"

# ================================================== ============== #
# Var: $folder
# ================================================== ============== #
# absolute URL (website address starting with http://) to folder
# files will be uploaded to. this variable correlates to the
# previous variable.

$folder = "http://www.allprint-france.fr/fichiersclient";

# ================================================== ============== #
# Var: $max
# ================================================== ============== #
# maximum file size (in kilobytes) you will accept as an upload.
# your host can, and often, does override this setting. if you
# cannot upload very large files, contact your host. it's not the
# the script, it's the server. this script has successfully uploaded
# files larger than the Windows XP operating system!
# 1024 kilobytes is equal to 1 megabyte

$max = 20000;

# ================================================== ============== #
# Var: $print_contents
# ================================================== ============== #
# set to 1 if you would like the contents of your upload directory
# ($dir) printed after a successful upload. set to 0 if you do not
# want filenames printed. note: this is ignored if redirecting the
# submitter to another page upon successful submission

$print_contents = 1;

# ================================================== ============== #
# Var: $overwrite
# ================================================== ============== #
# if the name of the file being uploaded already exists in your
# upload directory ($dir) and you DO NOT WANT it over-written,
# set this variable to 0 (zero). the script will then automatically
# rename the file by appending a unique number to it.
# if you DO WANT existing files to be over-written by the new upload,
# then set this variable to 1

$overwrite = 0;

# ================================================== ============== #
# Var: $domain
# ================================================== ============== #
# to ensure this script only processes forms that reside on your
# website, enter your domain name in this variable. the http://www
# portion is not required and best not be used.
#
# this helps prevent "hi-jacking" of your form. a technique
# practiced by hackers to have a program on their website or local
# computer programatically send out spam.
#
# note: this security measure is not fool proof and can be easily
# circumvented by hackers. additionally, some web surfers may
# unknowingly have the "referrer" variable cloaked, in which case,
# if you have this variable set, they will not be able to submit
# your form.
#
# we suggest you make use of the next security measure: @recipients

$domain = "";

# ================================================== ============== #
# Var: $domain
# ================================================== ============== #
#
# if a file is successfully uploaded, enter a URL to redirect to.
# use an absolute website address, as in :
# http://www.google.com
# leave this blank to have the default message printed.

$redirect = "";

# ================================================== ============== #
# Var: @types
# ================================================== ============== #
# enter the file extensions for the file types you will accept.
# this script can upload any type of file. each file extension on
# a new line, or enter "ALL" in uppercase, to accept all file types

@types = qw~

gif
jpg
jpeg
xls
pdf
doc
txt
tx

~;

################################################## ##################
# END USER EDITS
################################################## ##################

je laisse l'adresse de mon site: www.allprint-france.fr
page direct pour uploader des fichiers client dans le dossier "fichiersclient"
le fichier "upload.cgi" est dans son dossier cad /cgi-bin/ avec un chmod 755.

merci pour votre aide...

Michel74
16/05/2008, 23h36
Et si tu nous mettais ici ton script PEARL quelqu'un pourrait peut-être t'aider ?

tofinger
16/05/2008, 22h45
Bonjour
Voilà, j'intègre un site pour mon travail et par passion, je souhaite installer le script Ps Upload pour les fichiers de mes clients cependant je recherche un tuto ou une personne qui pourrait m'aider dans la configuration du script pearl.
J'ai une erreur de permission lors de mes test, alors que je suis bien en 755.
en tout cas merci d'avance
Tof