Jump to content

want to attach a file from my computer on webserver


priyanka

Recommended Posts

Hi,

 

I have a "notices" link on my website now  webadmin want one more option:

he want to upload any file eg .doc, .pdf etc along with text in this "Notice section". I have attached front and backend file. is there anyone who can help me

 

[attachment deleted by admin]

Link to comment
Share on other sites

okay your need to supplie the UserDetails class and please explain the problem again?

 

heres an example of a basic file upload script

<form enctype="multipart/form-data" action="" method="POST">
    <!-- MAX_FILE_SIZE must precede the file input field -->
    <input type="hidden" name="MAX_FILE_SIZE" value="30000" />
    Send this file: <input name="userfile" type="file" />
    <input type="submit" value="Upload File" />
</form>

<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.

$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
    echo "File is valid, and was successfully uploaded.\n";
} else {
    echo "Possible file upload attack!\n";
}

echo 'Here is some more debugging info:';
print_r($_FILES);

print "</pre>";

?>

Link to comment
Share on other sites

actually prblem is that  i want a file attachment facility on website. Suppose i want to upload any notice on the website then i should have to option to write Notice Heading, Some text matter and one option to upload any file (file uploading is not mandatory), if file already exists then flash a msg eg " File already exists" and it should have a option to revome any attachment too. (my Job portals have such option lke upload ur Cv along with pix). I hope i am able to explain it now

 

There is one file "User Detail" in Class folder... i think u are talking about dat

Link to comment
Share on other sites

thnx for ur time frnd. u got it right. I have nt written the code. one of my frnd did it who is on leave now a days due to marriage n i thought nt to disturb him.

i though it will be a small task and if someone can give me code then perhaps i can do it but seems i cant do it

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.