Jul 26, 2008

Upload Asp Code?

Free Web Hosting, No Ads > CONTRIBUTE > The Internet > Website Discussion

free web hosting

Upload Asp Code?

sargilla
is there an easy way to do this? i've been searching around and everything i've found looks very complicated. can someone point me to a resource that explains how to do this? just want something simple browse open and upload, with limit on the file size and just certain kind of files like pdfs and jpgs no exe or anything that could have viruses.

Reply

serverph
huh? blink.gif i'm lost. tongue.gif

but you can't use ASP on trap17 servers. tongue.gif so no point uploading them here when
you get hosted soon. try PHP instead.

on general issues about uploading, you can use your cpanel later, or an FTP app. (just
search the forums for these, this has been answered time and again here.)

or do you mean other things than what i tried to answer here? as i've said, i'm lost
in fully understanding what you are trying to express in your post. tongue.gif

Reply

sargilla
Ohh I thought asp was enabled on trap17, ummm well then I'll try something else, can you do that with php? I mean have people upload filed to the website, so then I can review them and post them on the respetive places....well thanks

Reply

NuHoaXuLa
If you only want upload files , simple use :
bool is_uploaded_file ( string filename)

and now is sample :
<?php
/* Userland test for uploaded file. */
function is_uploaded_file($filename)
{
if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
$tmp_file = dirname(tempnam('', ''));
}
$tmp_file .= '/' . basename($filename);
/* User might have trailing slash in php.ini... */
return (ereg_replace('/+', '/', $tmp_file) == $filename);
}

/* This is how to use it, since you also don't have
* move_uploaded_file() in these older versions: */
if (is_uploaded_file($HTTP_POST_FILES['userfile'])) {
copy($HTTP_POST_FILES['userfile'], "/place/to/put/uploaded/file");
} else {
echo "Possible file upload attack: filename '$HTTP_POST_FILES[userfile]'.";
}
?>


If you want upload in sql database , this is a short tutorial :

Step 1 : create a database :
CREATE TABLE binary_data (
id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY,
description CHAR(50),
bin_data LONGBLOB,
filename CHAR(50),
filesize CHAR(50),
filetype CHAR(50)
);

Step 2 : create ui to upload :
<?php
// code that will be executed if the form has been submitted:

if ($submit) {

// connect to the database
// (you may have to adjust the hostname,username or password)

MYSQL_CONNECT("localhost","root","password");
mysql_select_db("binary_data");

$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));

$result=MYSQL_QUERY("INSERT INTO binary_data (description,bin_data,filename,filesize,filetype) ".
"VALUES ('$form_description','$data','$form_data_name','$form_data_size','$form_data_type')");

$id= mysql_insert_id();
print "<p>This file has the following Database ID: <b>$id</b>";

MYSQL_CLOSE();

} else {

// else show the form to submit new data:
?>

<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
File Description:<br>
<input type="text" name="form_description" size="40">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<br>File to upload/store in database:<br>
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
</form>

<?php

}

?>

Step 3 : geting data :
<?php
if($id) {

// you may have to modify login information for your database server:
@MYSQL_CONNECT("localhost","root","password");

@mysql_select_db("binary_data");

$query = "select bin_data,filetype from binary_data where id=$id";
$result = @MYSQL_QUERY($query);

$data = @MYSQL_RESULT($result,0,"bin_data");
$type = @MYSQL_RESULT($result,0,"filetype");

Header( "Content-type: $type");
echo $data;

};
?>

Happy funny !
@};----------------------

 

 

 


Reply

filipc
ASP i only working on win systems.

Because , on win you have internet information server.

There is some software to install ASP on unix , i think , but i don't know how is it...

Reply

DMA
if you need a free asp host, then try searching for that on google. i dont understand what you mean, uploading an asp file is the same as uploading just about any other kind of file, there is nothing different between them.

Reply

Lyon
Use this host:


www.brinkster.com - chose the free educational package


Here you can use asp and asp.net and access databases.


I use it, it's very good.


The website editor is like frontpage.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. max_file_size asp - 93.87 hr back. (1)
Similar Topics

Keywords : upload asp code

  1. Google Has Sloppy Coders - Can't even code proper HTML (6)
  2. Upload Download Site - (10)
    I want to start to a site where users can upload any file for all users.Is there any legal issues
    involved...
  3. Deciphering Code - Code disassembling process of major sites (3)
    Can anyone actually get the code from the home pages of MSN, Yahoo!, Yahoo! Canada and eBay?
    I tried view Source and then copied it into an HTML editor, it took a while to decipher the code.
    How can I make my websites look like Yahoo! or MSN's if I cannot understand why they used
    the CSS in the first place? Do they use special software to design the page? By the way, if you can
    give me some tips on how to make my front page like theirs, it would be greatly appreciated....
  4. Upload File Upto 1gb On Yousendit.com - (6)
    hey guys...i wanted to inform that you can upload files upto 1GB on yousendit.com for free. so now
    you can upload your files on yousendit.com rather than rapidshare.de, which allows upto 100 mb. so
    now big files can be uploaded and downloaded easily in one piece....
  5. Php Code Snippets - I am looking for some PHP snippets. (1)
    Hello all, I am looking for a code php code snippet for my website that views the IP address of the
    person who is visiting. I know I saw it on someones website which was actaully on trap17.com but I
    cant remember the website and I really need this. Thanks. /biggrin.gif' border='0'
    style='vertical-align:middle' alt='biggrin.gif' /> ...
  6. Free & Good Tool - To optmize html code (2)
    The tool is named as: Absolute html compressor Just go to google.com and type this keywords, if
    you want to try this tool: "Download absolute html compressor" Of course there's alsow more
    ools that do this, but they're all shareware, this one is freeware and realy do a good work. I
    Have been using it and it realy reduce the size of the html page. Just try it, and then give me a
    feedback about it....



Looking for upload, asp, code

Searching Video's for upload, asp, code
advertisement



Upload Asp Code?



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE